{"_id":"@ems-press/unified-latex-util-ligatures","_rev":"7-f65ed988d170da6e6a916e953bac393d","name":"@ems-press/unified-latex-util-ligatures","dist-tags":{"latest":"1.7.1-ems"},"versions":{"1.7.1-ems":{"name":"@ems-press/unified-latex-util-ligatures","version":"1.7.1-ems","keywords":["pegjs","latex","parser","prettier","unified-latex","unified"],"author":{"name":"Jason Siefken"},"license":"MIT","_id":"@ems-press/unified-latex-util-ligatures@1.7.1-ems","maintainers":[{"name":"andrenarchy","email":"andre@gaul.io"},{"name":"mrwundf","email":"mr@wundf.net"},{"name":"heyarne","email":"arne-npm@schlueter.is"}],"homepage":"https://github.com/siefkenj/unified-latex#readme","bugs":{"url":"https://github.com/siefkenj/unified-latex/issues"},"dist":{"shasum":"d454799159139598ca7ebceadfee4803dc538976","tarball":"https://registry.npmjs.org/@ems-press/unified-latex-util-ligatures/-/unified-latex-util-ligatures-1.7.1-ems.tgz","fileCount":7,"integrity":"sha512-yMrUW6mv6XMCtt0+ggKIqUGoEJBdg/HUdwJcoyvfI+Nz3D2jeNyqoPEXBTuKjDWGHksecdT9mKKXhhuru83xPg==","signatures":[{"sig":"MEQCIHNizms/5GriOJ4mVn2FzJTlba2QtJMJAtIf5yojto+YAiB47CFgHU6dh3bjIEc4A1YdLrMHKqmhvp5qYhWtc6pbfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83159},"main":"index.js","type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.cjs"},"./*":{"types":"./*/index.d.ts","import":"./*/index.js","require":"./*/index.cjs"},"./*js":"./*js","./*/index":{"import":"./*/index.js","require":"./*/index.cjs"}},"gitHead":"9fc9cb5c652f1a995d3187b52682a59a5ec11421","_npmUser":{"name":"heyarne","email":"arne-npm@schlueter.is"},"repository":{"url":"git+https://github.com/siefkenj/unified-latex.git","type":"git"},"_npmVersion":"10.5.0","description":"Tools for manipulating unified-latex ASTs","directories":{},"_nodeVersion":"20.12.2","dependencies":{"@unified-latex/unified-latex-types":"^1.7.1","@unified-latex/unified-latex-util-match":"^1.7.1","@unified-latex/unified-latex-util-pegjs":"^1.7.1","@unified-latex/unified-latex-util-visit":"^1.7.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/unified-latex-util-ligatures_1.7.1-ems_1722866281367_0.982932264424085","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-08-05T13:58:01.366Z","modified":"2026-10-02T10:36:51.354Z","1.7.1-ems":"2024-08-05T13:58:01.528Z"},"bugs":{"url":"https://github.com/siefkenj/unified-latex/issues"},"author":{"name":"Jason Siefken"},"license":"MIT","homepage":"https://github.com/siefkenj/unified-latex#readme","keywords":["pegjs","latex","parser","prettier","unified-latex","unified"],"repository":{"url":"git+https://github.com/siefkenj/unified-latex.git","type":"git"},"description":"Tools for manipulating unified-latex ASTs","maintainers":[{"email":"andre@gaul.io","name":"andrenarchy"},{"email":"white@ems.press","name":"leemspress"},{"email":"schaal@ems.press","name":"gschems"}],"readme":"<!-- DO NOT MODIFY -->\n<!-- This file was autogenerated by build-docs.ts -->\n<!-- Edit the docstring in index.ts and regenerate -->\n<!-- rather than editing this file directly. -->\n# unified-latex-util-ligatures\n\n## What is this?\n\nFunctions to find and replace ligatures in a `unified-latex` Abstract Syntax Tree (AST) with their Unicode equivalents.\n\n## When should I use this?\n\nIf you are converting LaTeX to plain text or HTML.\n\n## Install\n\n```bash\nnpm install @unified-latex/unified-latex-util-ligatures\n```\n\nThis package contains both esm and commonjs exports. To explicitly access the esm export,\nimport the `.js` file. To explicitly access the commonjs export, import the `.cjs` file.\n\n# Functions\n\n## `createMatchers()`\n\n\n\n```typescript\nfunction createMatchers(): { isMacro: (node: any) => node is Ast.Macro; isWhitespace: (node: any) => node is Ast.Whitespace; isRecognized: (nodes: Ast.Node[], whitespaceAllowed?: boolean) => Ast.String; isSplitable: (node: Ast.Node) => boolean; split: (node: Ast.String) => { ...; }[]; }\n```\n\n## `expandUnicodeLigatures(tree)`\n\nTurn all ligatures into their unicode equivalent. For example,\n`---` -> an em-dash and `\\^o` to `ô`. This only applies in non-math mode,\nsince programs like katex will process math ligatures.\n\n```typescript\nfunction expandUnicodeLigatures(tree: Ast.Ast): void;\n```\n\n**Parameters**\n\n| Param | Type      |\n| :---- | :-------- |\n| tree  | `Ast.Ast` |\n\n## `parseLigatures(ast)`\n\nParse for recognized ligatures like `---` and `\\:o`, etc. These are\nreplaced with string nodes with the appropriate unicode character subbed in.\n\n```typescript\nfunction parseLigatures(ast: Ast.Node[]): Ast.Node[];\n```\n\n**Parameters**\n\n| Param | Type         |\n| :---- | :----------- |\n| ast   | `Ast.Node[]` |\n","readmeFilename":"README.md"}