├── .babelrc ├── .circleci └── config.yml ├── .gitignore ├── .npmignore ├── .yarnignore ├── LICENSE ├── README.md ├── assets ├── mmd-image-properties.webp └── mmd-vscode.png ├── doc ├── ACCESSIBILITY.md ├── icons │ ├── color-icons-render.html │ ├── color-icons.html │ ├── emoji-icons.html │ ├── fa-icons.html │ ├── icons.md │ ├── squared-icons.html │ ├── table-of-icons-render.html │ ├── table-of-icons.html │ └── unicode-icons.html ├── images │ ├── latex-footnotes │ │ ├── latex-footnotes_01.png │ │ ├── latex-footnotes_02.png │ │ ├── latex-footnotes_03.png │ │ └── latex-footnotes_04.png │ ├── latex-underline │ │ ├── latex-underline_01.png │ │ ├── latex-underline_02.png │ │ ├── latex-underline_03.png │ │ ├── latex-underline_04.png │ │ ├── latex-underline_05.png │ │ ├── latex-underline_06.png │ │ └── latex-underline_07.png │ ├── sections │ │ ├── section_01.png │ │ ├── section_02.png │ │ ├── section_03.png │ │ └── section_04.png │ ├── theorem_01.png │ ├── theorem_02.png │ ├── theorem_03.png │ ├── theorem_04.png │ ├── theorem_05.png │ ├── theorem_06.png │ ├── theorem_07.png │ └── theorems_and_proofs.png ├── latex-footnotes.md ├── latex-underline.md ├── sections.md └── theorems.md ├── es5 ├── bundle.js ├── context-menu.js ├── index.js └── index.js.map ├── examples ├── app.js ├── appPositions.js ├── compare-formats │ ├── README.md │ ├── app.js │ ├── format-cases.txt │ ├── package.json │ ├── result.html │ ├── result.txt │ └── views │ │ └── index.ejs ├── html │ ├── content-mmd-to-html.html │ ├── content-mmd-to-html.html.md │ ├── input-mmd-to-html.html │ └── input-mmd-to-html.html.md ├── mathpix-markdown-it-node-examples │ ├── README.md │ ├── app.js │ ├── conversion │ │ ├── math.js │ │ ├── math_outMath.js │ │ ├── tabular.js │ │ ├── tabular_include_sub_math.js │ │ ├── tabular_not_include_sub_math.js │ │ └── tabular_outMath.js │ ├── data.md │ ├── package.json │ └── views │ │ └── index.ejs ├── nextJS │ ├── README.md │ ├── app │ │ ├── data.js │ │ ├── favicon.ico │ │ ├── globals.css │ │ ├── layout.tsx │ │ └── page.tsx │ ├── next-env.d.ts │ ├── next.config.js │ ├── package.json │ ├── postcss.config.js │ ├── tailwind.config.ts │ └── tsconfig.json └── react-app │ ├── use-components │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── craco.config.js │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ └── src │ │ ├── App.js │ │ ├── _data.md │ │ └── index.js │ ├── use-markdownToHTML-method │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ └── src │ │ ├── App.js │ │ ├── form.jsx │ │ ├── index.js │ │ └── style.css │ ├── use-parseMarkdownByHTML-method │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ └── src │ │ ├── App.jsx │ │ ├── form.jsx │ │ ├── index.js │ │ └── style.css │ ├── use-render-method │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ └── src │ │ ├── App.jsx │ │ ├── data.js │ │ ├── index.js │ │ └── style.css │ └── use-toc │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── example-toc.gif │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ └── manifest.json │ └── src │ ├── App.jsx │ ├── data.js │ ├── form.jsx │ ├── index.js │ └── style.css ├── lib ├── bundle.d.ts ├── bundle.js ├── bundle.js.map ├── components │ ├── mathpix-loader │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map │ └── mathpix-markdown │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map ├── contex-menu │ ├── index.d.ts │ ├── index.js │ ├── index.js.map │ ├── menu │ │ ├── consts.d.ts │ │ ├── consts.js │ │ ├── consts.js.map │ │ ├── helper.d.ts │ │ ├── helper.js │ │ ├── helper.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── interfaces.d.ts │ │ ├── interfaces.js │ │ ├── interfaces.js.map │ │ ├── menu-item-actions.d.ts │ │ ├── menu-item-actions.js │ │ ├── menu-item-actions.js.map │ │ ├── menu-item.d.ts │ │ ├── menu-item.js │ │ ├── menu-item.js.map │ │ ├── menu-items.d.ts │ │ ├── menu-items.js │ │ └── menu-items.js.map │ ├── styles.d.ts │ ├── styles.js │ └── styles.js.map ├── context-menu.d.ts ├── context-menu.js ├── context-menu.js.map ├── copy-to-clipboard │ ├── clipboard-copy-element.d.ts │ ├── clipboard-copy-element.js │ ├── clipboard-copy-element.js.map │ ├── clipboard-copy-styles.d.ts │ ├── clipboard-copy-styles.js │ ├── clipboard-copy-styles.js.map │ ├── clipboard.d.ts │ ├── clipboard.js │ ├── clipboard.js.map │ ├── index.d.ts │ ├── index.js │ └── index.js.map ├── helpers │ ├── consts.d.ts │ ├── consts.js │ ├── consts.js.map │ ├── icons │ │ ├── css-colors.d.ts │ │ ├── css-colors.js │ │ ├── css-colors.js.map │ │ ├── emoji-icons.d.ts │ │ ├── emoji-icons.js │ │ ├── emoji-icons.js.map │ │ ├── emoji.d.ts │ │ ├── emoji.js │ │ ├── emoji.js.map │ │ ├── fa-icons.d.ts │ │ ├── fa-icons.js │ │ ├── fa-icons.js.map │ │ ├── icons.d.ts │ │ ├── icons.js │ │ ├── icons.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── squared-icons.d.ts │ │ ├── squared-icons.js │ │ ├── squared-icons.js.map │ │ ├── unicode-icons.d.ts │ │ ├── unicode-icons.js │ │ └── unicode-icons.js.map │ ├── normalize-link.d.ts │ ├── normalize-link.js │ ├── normalize-link.js.map │ ├── parse-mmd-element.d.ts │ ├── parse-mmd-element.js │ ├── parse-mmd-element.js.map │ ├── parze_link_destination.d.ts │ ├── parze_link_destination.js │ ├── parze_link_destination.js.map │ ├── utils.d.ts │ ├── utils.js │ └── utils.js.map ├── index.d.ts ├── index.js ├── index.js.map ├── markdown │ ├── common.d.ts │ ├── common.js │ ├── common.js.map │ ├── common │ │ ├── consts.d.ts │ │ ├── consts.js │ │ ├── consts.js.map │ │ ├── convert-math-to-html.d.ts │ │ ├── convert-math-to-html.js │ │ ├── convert-math-to-html.js.map │ │ ├── counters.d.ts │ │ ├── counters.js │ │ ├── counters.js.map │ │ ├── csv.d.ts │ │ ├── csv.js │ │ ├── csv.js.map │ │ ├── html-re.d.ts │ │ ├── html-re.js │ │ ├── html-re.js.map │ │ ├── labels.d.ts │ │ ├── labels.js │ │ ├── labels.js.map │ │ ├── mmdRules.d.ts │ │ ├── mmdRules.js │ │ ├── mmdRules.js.map │ │ ├── mmdRulesToDisable.d.ts │ │ ├── mmdRulesToDisable.js │ │ ├── mmdRulesToDisable.js.map │ │ ├── render-table-cell-content.d.ts │ │ ├── render-table-cell-content.js │ │ ├── render-table-cell-content.js.map │ │ ├── separating-span.d.ts │ │ ├── separating-span.js │ │ ├── separating-span.js.map │ │ ├── table-markdown.d.ts │ │ ├── table-markdown.js │ │ ├── table-markdown.js.map │ │ ├── text-dimentions.d.ts │ │ ├── text-dimentions.js │ │ ├── text-dimentions.js.map │ │ ├── textWidthByTokens.d.ts │ │ ├── textWidthByTokens.js │ │ ├── textWidthByTokens.js.map │ │ ├── tsv.d.ts │ │ ├── tsv.js │ │ └── tsv.js.map │ ├── dom-adaptor │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map │ ├── highlight │ │ ├── common.d.ts │ │ ├── common.js │ │ ├── common.js.map │ │ ├── highlight-math-token.d.ts │ │ ├── highlight-math-token.js │ │ ├── highlight-math-token.js.map │ │ ├── render-rule-highlights.d.ts │ │ ├── render-rule-highlights.js │ │ └── render-rule-highlights.js.map │ ├── index.d.ts │ ├── index.js │ ├── index.js.map │ ├── inline-styles │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map │ ├── mathpix-markdown-plugins.d.ts │ ├── mathpix-markdown-plugins.js │ ├── mathpix-markdown-plugins.js.map │ ├── md-ascii │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map │ ├── md-block-rule │ │ ├── begin-align.d.ts │ │ ├── begin-align.js │ │ ├── begin-align.js.map │ │ ├── begin-table.d.ts │ │ ├── begin-table.js │ │ ├── begin-table.js.map │ │ ├── begin-tabular │ │ │ ├── common.d.ts │ │ │ ├── common.js │ │ │ ├── common.js.map │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ ├── multi-column-row.d.ts │ │ │ ├── multi-column-row.js │ │ │ ├── multi-column-row.js.map │ │ │ ├── parse-tabular.d.ts │ │ │ ├── parse-tabular.js │ │ │ ├── parse-tabular.js.map │ │ │ ├── sub-cell.d.ts │ │ │ ├── sub-cell.js │ │ │ ├── sub-cell.js.map │ │ │ ├── sub-code.d.ts │ │ │ ├── sub-code.js │ │ │ ├── sub-code.js.map │ │ │ ├── sub-math.d.ts │ │ │ ├── sub-math.js │ │ │ ├── sub-math.js.map │ │ │ ├── sub-tabular.d.ts │ │ │ ├── sub-tabular.js │ │ │ ├── sub-tabular.js.map │ │ │ ├── tabular-td.d.ts │ │ │ ├── tabular-td.js │ │ │ └── tabular-td.js.map │ │ ├── helper.d.ts │ │ ├── helper.js │ │ ├── helper.js.map │ │ ├── image-block.d.ts │ │ ├── image-block.js │ │ ├── image-block.js.map │ │ ├── lists │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ ├── re-level.d.ts │ │ │ ├── re-level.js │ │ │ └── re-level.js.map │ │ ├── mathml-block.d.ts │ │ ├── mathml-block.js │ │ ├── mathml-block.js.map │ │ ├── mmd-fence.d.ts │ │ ├── mmd-fence.js │ │ ├── mmd-fence.js.map │ │ ├── mmd-html-block.d.ts │ │ ├── mmd-html-block.js │ │ ├── mmd-html-block.js.map │ │ ├── parse-error.d.ts │ │ ├── parse-error.js │ │ ├── parse-error.js.map │ │ ├── renewcommand.d.ts │ │ ├── renewcommand.js │ │ ├── renewcommand.js.map │ │ ├── svg_block.d.ts │ │ ├── svg_block.js │ │ └── svg_block.js.map │ ├── md-chemistry │ │ ├── chemistry-drawer.d.ts │ │ ├── chemistry-drawer.js │ │ ├── chemistry-drawer.js.map │ │ ├── chemistry-options.d.ts │ │ ├── chemistry-options.js │ │ ├── chemistry-options.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ └── smiles-drawer │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ └── src │ │ │ ├── ArrayHelper.d.ts │ │ │ ├── ArrayHelper.js │ │ │ ├── ArrayHelper.js.map │ │ │ ├── Atom.d.ts │ │ │ ├── Atom.js │ │ │ ├── Atom.js.map │ │ │ ├── CanvasWrapper.d.ts │ │ │ ├── CanvasWrapper.js │ │ │ ├── CanvasWrapper.js.map │ │ │ ├── Drawer.d.ts │ │ │ ├── Drawer.js │ │ │ ├── Drawer.js.map │ │ │ ├── Edge.d.ts │ │ │ ├── Edge.js │ │ │ ├── Edge.js.map │ │ │ ├── Graph.d.ts │ │ │ ├── Graph.js │ │ │ ├── Graph.js.map │ │ │ ├── Line.d.ts │ │ │ ├── Line.js │ │ │ ├── Line.js.map │ │ │ ├── MathHelper.d.ts │ │ │ ├── MathHelper.js │ │ │ ├── MathHelper.js.map │ │ │ ├── Parser.d.ts │ │ │ ├── Parser.js │ │ │ ├── Parser.js.map │ │ │ ├── Ring.d.ts │ │ │ ├── Ring.js │ │ │ ├── Ring.js.map │ │ │ ├── RingConnection.d.ts │ │ │ ├── RingConnection.js │ │ │ ├── RingConnection.js.map │ │ │ ├── SSSR.d.ts │ │ │ ├── SSSR.js │ │ │ ├── SSSR.js.map │ │ │ ├── SvgDrawer.d.ts │ │ │ ├── SvgDrawer.js │ │ │ ├── SvgDrawer.js.map │ │ │ ├── SvgWrapper.d.ts │ │ │ ├── SvgWrapper.js │ │ │ ├── SvgWrapper.js.map │ │ │ ├── ThemeManager.d.ts │ │ │ ├── ThemeManager.js │ │ │ ├── ThemeManager.js.map │ │ │ ├── UtilityFunctions.d.ts │ │ │ ├── UtilityFunctions.js │ │ │ ├── UtilityFunctions.js.map │ │ │ ├── Vector2.d.ts │ │ │ ├── Vector2.js │ │ │ ├── Vector2.js.map │ │ │ ├── Vertex.d.ts │ │ │ ├── Vertex.js │ │ │ └── Vertex.js.map │ ├── md-core-rules │ │ ├── set-positions.d.ts │ │ ├── set-positions.js │ │ └── set-positions.js.map │ ├── md-inline-rule │ │ ├── core-inline.d.ts │ │ ├── core-inline.js │ │ ├── core-inline.js.map │ │ ├── diagbox-inline.d.ts │ │ ├── diagbox-inline.js │ │ ├── diagbox-inline.js.map │ │ ├── html_inline_full_tag.d.ts │ │ ├── html_inline_full_tag.js │ │ ├── html_inline_full_tag.js.map │ │ ├── image.d.ts │ │ ├── image.js │ │ ├── image.js.map │ │ ├── includegraphics.d.ts │ │ ├── includegraphics.js │ │ ├── includegraphics.js.map │ │ ├── lists.d.ts │ │ ├── lists.js │ │ ├── lists.js.map │ │ ├── mathml-inline.d.ts │ │ ├── mathml-inline.js │ │ ├── mathml-inline.js.map │ │ ├── mmd-icon.d.ts │ │ ├── mmd-icon.js │ │ ├── mmd-icon.js.map │ │ ├── new-line-to-space.d.ts │ │ ├── new-line-to-space.js │ │ ├── new-line-to-space.js.map │ │ ├── refs.d.ts │ │ ├── refs.js │ │ ├── refs.js.map │ │ ├── renewcommand.d.ts │ │ ├── renewcommand.js │ │ ├── renewcommand.js.map │ │ ├── setcounter-section.d.ts │ │ ├── setcounter-section.js │ │ ├── setcounter-section.js.map │ │ ├── tabular.d.ts │ │ ├── tabular.js │ │ ├── tabular.js.map │ │ ├── text-collapse.d.ts │ │ ├── text-collapse.js │ │ ├── text-collapse.js.map │ │ ├── text-mode.d.ts │ │ ├── text-mode.js │ │ ├── text-mode.js.map │ │ ├── underline.d.ts │ │ ├── underline.js │ │ ├── underline.js.map │ │ ├── utils.d.ts │ │ ├── utils.js │ │ └── utils.js.map │ ├── md-inline-rule2 │ │ ├── mmd-html_inline2.d.ts │ │ ├── mmd-html_inline2.js │ │ └── mmd-html_inline2.js.map │ ├── md-latex-footnotes │ │ ├── block-rule.d.ts │ │ ├── block-rule.js │ │ ├── block-rule.js.map │ │ ├── core-rule.d.ts │ │ ├── core-rule.js │ │ ├── core-rule.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── inline-rule.d.ts │ │ ├── inline-rule.js │ │ ├── inline-rule.js.map │ │ ├── inline-ruler2.d.ts │ │ ├── inline-ruler2.js │ │ ├── inline-ruler2.js.map │ │ ├── interfaces.d.ts │ │ ├── interfaces.js │ │ ├── interfaces.js.map │ │ ├── render-rule.d.ts │ │ ├── render-rule.js │ │ ├── render-rule.js.map │ │ ├── utils.d.ts │ │ ├── utils.js │ │ └── utils.js.map │ ├── md-renderer-rules │ │ ├── breaks.d.ts │ │ ├── breaks.js │ │ ├── breaks.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── render-diagbox.d.ts │ │ ├── render-diagbox.js │ │ ├── render-diagbox.js.map │ │ ├── render-lists.d.ts │ │ ├── render-lists.js │ │ ├── render-lists.js.map │ │ ├── render-tabular.d.ts │ │ ├── render-tabular.js │ │ ├── render-tabular.js.map │ │ ├── underline.d.ts │ │ ├── underline.js │ │ └── underline.js.map │ ├── md-svg-to-base64 │ │ ├── base64.d.ts │ │ ├── base64.js │ │ ├── base64.js.map │ │ ├── convert-scv-to-base64.d.ts │ │ ├── convert-scv-to-base64.js │ │ ├── convert-scv-to-base64.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map │ ├── md-theorem │ │ ├── block-rule.d.ts │ │ ├── block-rule.js │ │ ├── block-rule.js.map │ │ ├── helper.d.ts │ │ ├── helper.js │ │ ├── helper.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── inline-rule.d.ts │ │ ├── inline-rule.js │ │ └── inline-rule.js.map │ ├── mdHighlightCodePlugin.d.ts │ ├── mdHighlightCodePlugin.js │ ├── mdHighlightCodePlugin.js.map │ ├── mdOptions.d.ts │ ├── mdOptions.js │ ├── mdOptions.js.map │ ├── mdPluginAnchor.d.ts │ ├── mdPluginAnchor.js │ ├── mdPluginAnchor.js.map │ ├── mdPluginCollapsible.d.ts │ ├── mdPluginCollapsible.js │ ├── mdPluginCollapsible.js.map │ ├── mdPluginConfigured.d.ts │ ├── mdPluginConfigured.js │ ├── mdPluginConfigured.js.map │ ├── mdPluginLists.d.ts │ ├── mdPluginLists.js │ ├── mdPluginLists.js.map │ ├── mdPluginRaw.d.ts │ ├── mdPluginRaw.js │ ├── mdPluginRaw.js.map │ ├── mdPluginSeparateForBlock.d.ts │ ├── mdPluginSeparateForBlock.js │ ├── mdPluginSeparateForBlock.js.map │ ├── mdPluginTOC.d.ts │ ├── mdPluginTOC.js │ ├── mdPluginTOC.js.map │ ├── mdPluginTableTabular.d.ts │ ├── mdPluginTableTabular.js │ ├── mdPluginTableTabular.js.map │ ├── mdPluginText.d.ts │ ├── mdPluginText.js │ ├── mdPluginText.js.map │ ├── mdSetPositionsAndHighlight.d.ts │ ├── mdSetPositionsAndHighlight.js │ ├── mdSetPositionsAndHighlight.js.map │ ├── rules.d.ts │ ├── rules.js │ ├── rules.js.map │ ├── sanitize │ │ ├── attrs.d.ts │ │ ├── attrs.js │ │ ├── attrs.js.map │ │ ├── consts.d.ts │ │ ├── consts.js │ │ ├── consts.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── sanitize-html.d.ts │ │ ├── sanitize-html.js │ │ ├── sanitize-html.js.map │ │ ├── tags.d.ts │ │ ├── tags.js │ │ └── tags.js.map │ ├── utils.d.ts │ ├── utils.js │ └── utils.js.map ├── mathjax │ ├── fix-unicode.d.ts │ ├── fix-unicode.js │ ├── fix-unicode.js.map │ ├── helpers │ │ ├── array │ │ │ ├── ArrayConfiguration.d.ts │ │ │ ├── ArrayConfiguration.js │ │ │ ├── ArrayConfiguration.js.map │ │ │ ├── ArrayMappings.d.ts │ │ │ ├── ArrayMappings.js │ │ │ ├── ArrayMappings.js.map │ │ │ ├── ArrayMethods.d.ts │ │ │ ├── ArrayMethods.js │ │ │ └── ArrayMethods.js.map │ │ └── icon │ │ │ ├── IconConfiguration.d.ts │ │ │ ├── IconConfiguration.js │ │ │ ├── IconConfiguration.js.map │ │ │ ├── IconConstants.d.ts │ │ │ ├── IconConstants.js │ │ │ ├── IconConstants.js.map │ │ │ ├── IconMethods.d.ts │ │ │ ├── IconMethods.js │ │ │ ├── IconMethods.js.map │ │ │ ├── IconUtil.d.ts │ │ │ ├── IconUtil.js │ │ │ └── IconUtil.js.map │ ├── index.d.ts │ ├── index.js │ ├── index.js.map │ ├── mathJaxConfig.d.ts │ ├── mathJaxConfig.js │ ├── mathJaxConfig.js.map │ ├── mathjax.d.ts │ ├── mathjax.js │ ├── mathjax.js.map │ ├── mathml-word.d.ts │ ├── mathml-word.js │ ├── mathml-word.js.map │ ├── my-BaseMappings.d.ts │ ├── my-BaseMappings.js │ ├── my-BaseMappings.js.map │ ├── serialized-ascii │ │ ├── common.d.ts │ │ ├── common.js │ │ ├── common.js.map │ │ ├── handlers.d.ts │ │ ├── handlers.js │ │ ├── handlers.js.map │ │ ├── helperA.d.ts │ │ ├── helperA.js │ │ ├── helperA.js.map │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map │ ├── utils.d.ts │ ├── utils.js │ └── utils.js.map ├── mathpix-markdown-model │ ├── check-formula.d.ts │ ├── check-formula.js │ ├── check-formula.js.map │ ├── html-page.d.ts │ ├── html-page.js │ ├── html-page.js.map │ ├── index.d.ts │ ├── index.js │ └── index.js.map ├── sre │ ├── index.d.ts │ ├── index.js │ ├── index.js.map │ ├── sre-browser.d.ts │ ├── sre-browser.js │ ├── sre-browser.js.map │ ├── sre-node.d.ts │ ├── sre-node.js │ └── sre-node.js.map ├── styles │ ├── halpers.d.ts │ ├── halpers.js │ ├── halpers.js.map │ ├── index.d.ts │ ├── index.js │ ├── index.js.map │ ├── styles-code.d.ts │ ├── styles-code.js │ ├── styles-code.js.map │ ├── styles-container.d.ts │ ├── styles-container.js │ ├── styles-container.js.map │ ├── styles-fonts.d.ts │ ├── styles-fonts.js │ ├── styles-fonts.js.map │ ├── styles-lists.d.ts │ ├── styles-lists.js │ ├── styles-lists.js.map │ ├── styles-tabular.d.ts │ ├── styles-tabular.js │ └── styles-tabular.js.map └── yaml-parser │ ├── index.d.ts │ ├── index.js │ └── index.js.map ├── package-lock.json ├── package.json ├── src ├── bundle.tsx ├── components │ ├── mathpix-loader │ │ └── index.tsx │ └── mathpix-markdown │ │ └── index.tsx ├── contex-menu │ ├── index.ts │ ├── menu │ │ ├── consts.ts │ │ ├── helper.ts │ │ ├── index.ts │ │ ├── interfaces.ts │ │ ├── menu-item-actions.ts │ │ ├── menu-item.ts │ │ └── menu-items.ts │ └── styles.ts ├── context-menu.tsx ├── copy-to-clipboard │ ├── clipboard-copy-element.ts │ ├── clipboard-copy-styles.ts │ ├── clipboard.ts │ └── index.ts ├── helpers │ ├── consts.ts │ ├── icons │ │ ├── css-colors.ts │ │ ├── emoji-icons.ts │ │ ├── fa-icons.ts │ │ ├── index.ts │ │ ├── squared-icons.ts │ │ └── unicode-icons.ts │ ├── normalize-link.ts │ ├── parse-mmd-element.ts │ ├── parze_link_destination.ts │ └── utils.ts ├── index.tsx ├── markdown │ ├── common.ts │ ├── common │ │ ├── consts.ts │ │ ├── convert-math-to-html.ts │ │ ├── counters.ts │ │ ├── csv.ts │ │ ├── html-re.ts │ │ ├── labels.ts │ │ ├── mmdRules.ts │ │ ├── mmdRulesToDisable.ts │ │ ├── render-table-cell-content.ts │ │ ├── separating-span.ts │ │ ├── table-markdown.ts │ │ ├── text-dimentions.ts │ │ ├── textWidthByTokens.ts │ │ └── tsv.ts │ ├── dom-adaptor │ │ └── index.ts │ ├── highlight │ │ ├── common.ts │ │ ├── highlight-math-token.ts │ │ └── render-rule-highlights.ts │ ├── index.ts │ ├── inline-styles │ │ └── index.ts │ ├── mathpix-markdown-plugins.ts │ ├── md-ascii │ │ └── index.ts │ ├── md-block-rule │ │ ├── begin-align.ts │ │ ├── begin-table.ts │ │ ├── begin-tabular │ │ │ ├── common.ts │ │ │ ├── index.ts │ │ │ ├── multi-column-row.ts │ │ │ ├── parse-tabular.ts │ │ │ ├── sub-cell.ts │ │ │ ├── sub-code.ts │ │ │ ├── sub-math.ts │ │ │ ├── sub-tabular.ts │ │ │ └── tabular-td.ts │ │ ├── helper.ts │ │ ├── image-block.ts │ │ ├── lists │ │ │ ├── index.ts │ │ │ └── re-level.ts │ │ ├── mathml-block.ts │ │ ├── mmd-fence.ts │ │ ├── mmd-html-block.ts │ │ ├── parse-error.ts │ │ ├── renewcommand.ts │ │ └── svg_block.ts │ ├── md-chemistry │ │ ├── chemistry-drawer.ts │ │ ├── chemistry-options.ts │ │ ├── index.ts │ │ └── smiles-drawer │ │ │ ├── index.ts │ │ │ └── src │ │ │ ├── ArrayHelper.ts │ │ │ ├── Atom.ts │ │ │ ├── CanvasWrapper.ts │ │ │ ├── Drawer.ts │ │ │ ├── Edge.ts │ │ │ ├── Graph.ts │ │ │ ├── Line.ts │ │ │ ├── MathHelper.ts │ │ │ ├── Parser.ts │ │ │ ├── Ring.ts │ │ │ ├── RingConnection.ts │ │ │ ├── SSSR.ts │ │ │ ├── SvgDrawer.ts │ │ │ ├── SvgWrapper.ts │ │ │ ├── ThemeManager.ts │ │ │ ├── UtilityFunctions.ts │ │ │ ├── Vector2.ts │ │ │ └── Vertex.ts │ ├── md-core-rules │ │ └── set-positions.ts │ ├── md-inline-rule │ │ ├── core-inline.ts │ │ ├── diagbox-inline.ts │ │ ├── html_inline_full_tag.ts │ │ ├── image.ts │ │ ├── includegraphics.ts │ │ ├── lists.ts │ │ ├── mathml-inline.ts │ │ ├── mmd-icon.ts │ │ ├── new-line-to-space.ts │ │ ├── refs.ts │ │ ├── renewcommand.ts │ │ ├── setcounter-section.ts │ │ ├── tabular.ts │ │ ├── text-collapse.ts │ │ ├── text-mode.ts │ │ ├── underline.ts │ │ └── utils.ts │ ├── md-inline-rule2 │ │ └── mmd-html_inline2.ts │ ├── md-latex-footnotes │ │ ├── block-rule.ts │ │ ├── core-rule.ts │ │ ├── index.ts │ │ ├── inline-rule.ts │ │ ├── inline-ruler2.ts │ │ ├── interfaces.ts │ │ ├── render-rule.ts │ │ └── utils.ts │ ├── md-renderer-rules │ │ ├── breaks.ts │ │ ├── index.ts │ │ ├── render-diagbox.ts │ │ ├── render-lists.ts │ │ ├── render-tabular.ts │ │ └── underline.ts │ ├── md-svg-to-base64 │ │ ├── base64.ts │ │ ├── convert-scv-to-base64.ts │ │ └── index.ts │ ├── md-theorem │ │ ├── block-rule.ts │ │ ├── helper.ts │ │ ├── index.ts │ │ └── inline-rule.ts │ ├── mdHighlightCodePlugin.ts │ ├── mdOptions.ts │ ├── mdPluginAnchor.ts │ ├── mdPluginCollapsible.ts │ ├── mdPluginConfigured.ts │ ├── mdPluginLists.ts │ ├── mdPluginRaw.ts │ ├── mdPluginSeparateForBlock.ts │ ├── mdPluginTOC.ts │ ├── mdPluginTableTabular.ts │ ├── mdPluginText.ts │ ├── mdSetPositionsAndHighlight.ts │ ├── rules.ts │ ├── sanitize │ │ ├── attrs.ts │ │ ├── consts.ts │ │ ├── index.ts │ │ ├── sanitize-html.ts │ │ └── tags.ts │ └── utils.ts ├── mathjax │ ├── fix-unicode.ts │ ├── helpers │ │ ├── array │ │ │ ├── ArrayConfiguration.ts │ │ │ ├── ArrayMappings.ts │ │ │ └── ArrayMethods.ts │ │ └── icon │ │ │ └── IconConfiguration.ts │ ├── index.ts │ ├── mathJaxConfig.ts │ ├── mathjax.ts │ ├── mathml-word.ts │ ├── my-BaseMappings.ts │ ├── serialized-ascii │ │ ├── common.ts │ │ ├── handlers.ts │ │ ├── helperA.ts │ │ └── index.ts │ └── utils.ts ├── mathpix-markdown-model │ ├── check-formula.ts │ ├── html-page.ts │ └── index.ts ├── sre │ ├── index.ts │ ├── sre-browser.ts │ └── sre-node.ts ├── styles │ ├── halpers.ts │ ├── index.ts │ ├── styles-code.ts │ ├── styles-container.ts │ ├── styles-fonts.ts │ ├── styles-lists.ts │ └── styles-tabular.ts └── yaml-parser │ └── index.ts ├── tests ├── _accessibility.js ├── _ascii-render.js ├── _ascii.js ├── _csv.js ├── _data │ ├── _accessibility │ │ └── _data.js │ ├── _ascii │ │ ├── _asciiData.js │ │ ├── _asciiLongDiv.js │ │ ├── _asciiMore.js │ │ ├── _asciiOperationSymbols.js │ │ ├── _asciiSpace.js │ │ ├── _asciiTimes.js │ │ ├── _ascii_frac.js │ │ ├── _ascii_lcm.js │ │ ├── _ascii_sup_with_wedge.js │ │ └── _ascii_vertical_math.js │ ├── _csv │ │ └── _data.js │ ├── _footnotes │ │ ├── _html.js │ │ └── _mmd.js │ ├── _footnotes_latex │ │ ├── _data-footnote.js │ │ ├── _data-footnotetext.js │ │ ├── _html │ │ │ ├── _html_01.js │ │ │ ├── _html_02.js │ │ │ ├── _html_03.js │ │ │ ├── _html_04.js │ │ │ ├── _html_05.js │ │ │ ├── _html_08.js │ │ │ ├── _html_09.js │ │ │ ├── _html_10.js │ │ │ ├── _html_11.js │ │ │ ├── _html_12.js │ │ │ └── _html_13.js │ │ └── _mmd │ │ │ ├── _mmd_01.js │ │ │ ├── _mmd_02.js │ │ │ ├── _mmd_03.js │ │ │ ├── _mmd_04.js │ │ │ ├── _mmd_05.js │ │ │ ├── _mmd_08.js │ │ │ ├── _mmd_09.js │ │ │ ├── _mmd_10.js │ │ │ ├── _mmd_11.js │ │ │ ├── _mmd_12.js │ │ │ └── _mmd_13.js │ ├── _highlights │ │ └── _data.js │ ├── _html-tag-matching │ │ └── _data.js │ ├── _icon │ │ └── _data.js │ ├── _image │ │ └── _data.js │ ├── _labels │ │ └── _data.js │ ├── _latex-text │ │ ├── _data.js │ │ └── _pageBreak.js │ ├── _lists │ │ └── _data.js │ ├── _markdownToHTMLWithSize │ │ ├── _data.js │ │ ├── _data_bold.js │ │ └── fonts │ │ │ ├── Arial-Bold.ttf │ │ │ └── Arial.ttf │ ├── _mathjax │ │ └── _data.js │ ├── _mathml_word │ │ └── _data.js │ ├── _nonumbers │ │ └── _data.js │ ├── _parseMarkdownByHTML │ │ └── _data.js │ ├── _pluginText │ │ └── _data.js │ ├── _refs │ │ └── _data.js │ ├── _renderOprions │ │ ├── _html.js │ │ ├── _html_disable_all_rules.js │ │ ├── _html_disable_latex.js │ │ ├── _html_disable_markdown.js │ │ ├── _html_disable_markdown_mmd_extensions.js │ │ └── _mmd.js │ ├── _sanitizeHtml │ │ ├── _data.js │ │ └── _data_htmlCheckTagMatching.js │ ├── _sections │ │ └── _data.js │ ├── _sepatation_span │ │ ├── _data.js │ │ ├── _data_fence.js │ │ └── _data_fence_tr.js │ ├── _smiles │ │ ├── _data1.js │ │ ├── _data2.js │ │ ├── _data3.js │ │ ├── _data4.js │ │ ├── _data5.js │ │ ├── _data6.js │ │ ├── _data_CCOc1ccc2oc.js │ │ ├── _markush.js │ │ ├── _more │ │ │ ├── _chembl.js │ │ │ └── _new.js │ │ └── _simple_aromatic_rings.js │ ├── _smilesParse │ │ └── _data.js │ ├── _svg_chart │ │ └── _data.js │ ├── _svg_chem │ │ └── _data.js │ ├── _svg_table │ │ └── _data.js │ ├── _table-markdown │ │ └── _data.js │ ├── _tables │ │ └── _data.js │ ├── _tabular │ │ ├── _data.js │ │ ├── _data_digbox.js │ │ └── _data_sub.js │ ├── _theorem │ │ └── _data.js │ ├── _toc │ │ ├── _data-list.js │ │ └── _data-summary.js │ ├── _tokenPositions │ │ ├── _data.js │ │ ├── _data_abstract.js │ │ ├── _data_author.js │ │ ├── _data_lists.js │ │ └── _data_sections.js │ ├── _tsv │ │ ├── _data.js │ │ └── _dataFormats.js │ └── _tsv_with_array │ │ ├── _data.js │ │ ├── _data_gathered_aligned.js │ │ └── _data_include_sub_math.js ├── _footnotes.js ├── _footnotes_latex.js ├── _highlights.js ├── _html-tag-matching.js ├── _icon.js ├── _image.js ├── _labels.js ├── _latex-text.js ├── _lists.js ├── _markdownToHTMLWithSize.js ├── _mathjax.js ├── _mathml_word.js ├── _nonumbers.js ├── _parseMarkdownByHTML.js ├── _pluginText.js ├── _refs.js ├── _renderOptions.js ├── _sanitize.js ├── _sections.js ├── _sepatation_span.js ├── _smiles.js ├── _smilesParse.js ├── _svgChart.js ├── _svgChem.js ├── _svgTable.js ├── _table-markdown.js ├── _tables.js ├── _tabular.js ├── _theorem.js ├── _toc.js ├── _tokenPositions.js ├── _tsv.js └── _tsv_with_array.js ├── tsconfig.json ├── webpack.config.js └── webpack.dev.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["@babel/preset-env", { 4 | "debug":true 5 | }] 6 | ], 7 | "plugins": [ 8 | ["@babel/transform-runtime"] 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /examples/mathpix-markdown-it-node-examples/node_modules 3 | /examples/mathpix-markdown-it-node-examples/package-lock.json 4 | /examples/compare-formats/node_modules 5 | /examples/compare-formats/package-lock.json 6 | /examples/react-app/use-components/node_modules 7 | /examples/react-app/use-components/package-lock.json 8 | /examples/react-app/use-components/yarn.lock 9 | /examples/react-app/use-render-method/node_modules 10 | /examples/react-app/use-render-method/package-lock.json 11 | /examples/react-app/use-render-method/yarn.lock 12 | /examples/react-app/use-markdownToHTML-method/node_modules 13 | /examples/react-app/use-markdownToHTML-method/package-lock.json 14 | /examples/react-app/use-markdownToHTML-method/yarn.lock 15 | /examples/react-app/use-parseMarkdownByHTML-method/node_modules 16 | /examples/react-app/use-parseMarkdownByHTML-method/package-lock.json 17 | /examples/react-app/use-parseMarkdownByHTML-method/yarn.lock 18 | examples/react-app/use-toc/package-lock.json 19 | examples/nextJS/node_modules 20 | examples/nextJS/pnpm-lock.yaml 21 | examples/nextJS/package-lock.json 22 | examples/nextJS/.next 23 | yarn.lock 24 | /.idea 25 | .DS_Store 26 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /src 2 | /node_modules 3 | /examples 4 | /tests 5 | webpack.config.js 6 | webpack.dev.js 7 | .gitignore 8 | .yarnignore 9 | -------------------------------------------------------------------------------- /.yarnignore: -------------------------------------------------------------------------------- 1 | /src 2 | /node_modules 3 | /examples 4 | /tests 5 | webpack.config.js 6 | webpack.dev.js 7 | .gitignore 8 | .npmignore 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Mathpix 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/mmd-image-properties.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/assets/mmd-image-properties.webp -------------------------------------------------------------------------------- /assets/mmd-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/assets/mmd-vscode.png -------------------------------------------------------------------------------- /doc/icons/icons.md: -------------------------------------------------------------------------------- 1 | # Icons 2 | 3 | - [Unicode icons](https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/777e8684d2d220311ce64d4a6c5f442d41a40cf3/doc/icons/unicode-icons.html) 4 | - [Squared icons](https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/777e8684d2d220311ce64d4a6c5f442d41a40cf3/doc/icons/squared-icons.html) 5 | - [Emoji icons](https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/777e8684d2d220311ce64d4a6c5f442d41a40cf3/doc/icons/emoji-icons.html) 6 | - [fa-icons](https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/777e8684d2d220311ce64d4a6c5f442d41a40cf3/doc/icons/fa-icons.html) 7 | 8 | ## Color icons 9 | 10 | - [Color icons](https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/dev/olga/13534-Request-to-add-some-icons-v1/doc/icons/color-icons.html) 11 | 12 | ## Table of icons 13 | 14 | - [Table of icons](https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/dev/olga/13534-Request-to-add-some-icons-v1/doc/icons/table-of-icons.html) 15 | -------------------------------------------------------------------------------- /doc/images/latex-footnotes/latex-footnotes_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-footnotes/latex-footnotes_01.png -------------------------------------------------------------------------------- /doc/images/latex-footnotes/latex-footnotes_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-footnotes/latex-footnotes_02.png -------------------------------------------------------------------------------- /doc/images/latex-footnotes/latex-footnotes_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-footnotes/latex-footnotes_03.png -------------------------------------------------------------------------------- /doc/images/latex-footnotes/latex-footnotes_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-footnotes/latex-footnotes_04.png -------------------------------------------------------------------------------- /doc/images/latex-underline/latex-underline_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-underline/latex-underline_01.png -------------------------------------------------------------------------------- /doc/images/latex-underline/latex-underline_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-underline/latex-underline_02.png -------------------------------------------------------------------------------- /doc/images/latex-underline/latex-underline_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-underline/latex-underline_03.png -------------------------------------------------------------------------------- /doc/images/latex-underline/latex-underline_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-underline/latex-underline_04.png -------------------------------------------------------------------------------- /doc/images/latex-underline/latex-underline_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-underline/latex-underline_05.png -------------------------------------------------------------------------------- /doc/images/latex-underline/latex-underline_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-underline/latex-underline_06.png -------------------------------------------------------------------------------- /doc/images/latex-underline/latex-underline_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/latex-underline/latex-underline_07.png -------------------------------------------------------------------------------- /doc/images/sections/section_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/sections/section_01.png -------------------------------------------------------------------------------- /doc/images/sections/section_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/sections/section_02.png -------------------------------------------------------------------------------- /doc/images/sections/section_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/sections/section_03.png -------------------------------------------------------------------------------- /doc/images/sections/section_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/sections/section_04.png -------------------------------------------------------------------------------- /doc/images/theorem_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorem_01.png -------------------------------------------------------------------------------- /doc/images/theorem_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorem_02.png -------------------------------------------------------------------------------- /doc/images/theorem_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorem_03.png -------------------------------------------------------------------------------- /doc/images/theorem_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorem_04.png -------------------------------------------------------------------------------- /doc/images/theorem_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorem_05.png -------------------------------------------------------------------------------- /doc/images/theorem_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorem_06.png -------------------------------------------------------------------------------- /doc/images/theorem_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorem_07.png -------------------------------------------------------------------------------- /doc/images/theorems_and_proofs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/doc/images/theorems_and_proofs.png -------------------------------------------------------------------------------- /examples/compare-formats/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "ejs": "^3.0.1", 13 | "express": "^4.17.1", 14 | "jsdom": "^16.0.0", 15 | "mathpix-markdown-it": "../../../mathpix-markdown-it", 16 | "window": "^4.2.6" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/compare-formats/views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= site.title %> 6 | 7 | 8 | 9 | 10 | 11 | <%- body %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/html/content-mmd-to-html.html.md: -------------------------------------------------------------------------------- 1 | # [content-mmd-to-html.html](https://github.com/Mathpix/mathpix-markdown-it/tree/master/examples/html/content-mmd-to-html.html) 2 | 3 | 4 | ``` html 5 | 26 | ``` 27 | 28 | 29 | ``` 30 |
31 | ``` 32 | 33 | [Run the example](https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/master/examples/html/content-mmd-to-html.html) 34 | -------------------------------------------------------------------------------- /examples/mathpix-markdown-it-node-examples/conversion/math.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const bodyParser = require('body-parser'); 3 | const ejs = require('ejs'); 4 | const http = require('http'); 5 | const path = require('path'); 6 | const fs = require('fs'); 7 | 8 | const Window = require('window'); 9 | const window = new Window(); 10 | global.window = window; 11 | global.document = window.document; 12 | 13 | const jsdom = require("jsdom"); 14 | const { JSDOM } = jsdom; 15 | global.DOMParser = new JSDOM().window.DOMParser; 16 | 17 | const {MathpixMarkdownModel} = require('mathpix-markdown-it'); 18 | 19 | const options = { 20 | outMath: { 21 | include_mathml: true, 22 | include_asciimath: true, 23 | include_latex: true, 24 | include_svg: true, 25 | include_tsv: true, 26 | include_table_html: true, 27 | } 28 | }; 29 | const latex = `$x^x$`; 30 | const html = MathpixMarkdownModel.markdownToHTML(latex, options); 31 | const parsed = MathpixMarkdownModel.parseMarkdownByHTML(html, false); 32 | 33 | console.log('html=>', html); 34 | console.log('parsed=>', parsed); 35 | -------------------------------------------------------------------------------- /examples/mathpix-markdown-it-node-examples/conversion/math_outMath.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const bodyParser = require('body-parser'); 3 | const ejs = require('ejs'); 4 | const http = require('http'); 5 | const path = require('path'); 6 | const fs = require('fs'); 7 | 8 | const Window = require('window'); 9 | const window = new Window(); 10 | global.window = window; 11 | global.document = window.document; 12 | 13 | const jsdom = require("jsdom"); 14 | const { JSDOM } = jsdom; 15 | global.DOMParser = new JSDOM().window.DOMParser; 16 | 17 | const {MathpixMarkdownModel} = require('mathpix-markdown-it'); 18 | 19 | const options = { 20 | outMath: { 21 | include_mathml: false, 22 | include_asciimath: true, 23 | include_latex: false, 24 | } 25 | }; 26 | const latex = `$x^x$`; 27 | const html = MathpixMarkdownModel.markdownToHTML(latex, options); 28 | const parsed = MathpixMarkdownModel.parseMarkdownByHTML(html, false); 29 | 30 | console.log('html=>', html); 31 | console.log('parsed=>', parsed); 32 | -------------------------------------------------------------------------------- /examples/mathpix-markdown-it-node-examples/conversion/tabular.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const bodyParser = require('body-parser'); 3 | const ejs = require('ejs'); 4 | const http = require('http'); 5 | const path = require('path'); 6 | const fs = require('fs'); 7 | 8 | const Window = require('window'); 9 | const window = new Window(); 10 | global.window = window; 11 | global.document = window.document; 12 | 13 | const jsdom = require("jsdom"); 14 | const { JSDOM } = jsdom; 15 | global.DOMParser = new JSDOM().window.DOMParser; 16 | 17 | const {MathpixMarkdownModel} = require('mathpix-markdown-it'); 18 | 19 | const options = { 20 | outMath: { 21 | include_mathml: true, 22 | include_asciimath: true, 23 | include_latex: true, 24 | include_svg: true, 25 | include_tsv: true, 26 | include_table_html: true, 27 | } 28 | }; 29 | const latex = `\\begin{tabular}{ l c r } 30 | 1 & 2 & 3 \\\\ 31 | 4 & 5 & 6 \\\\ 32 | 7 & 8 & 9 \\\\ 33 | \\end{tabular}`; 34 | const html = MathpixMarkdownModel.markdownToHTML(latex, options); 35 | const parsed = MathpixMarkdownModel.parseMarkdownByHTML(html, false); 36 | 37 | console.log('html=>', html); 38 | console.log('parsed=>', parsed); 39 | -------------------------------------------------------------------------------- /examples/mathpix-markdown-it-node-examples/conversion/tabular_outMath.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const bodyParser = require('body-parser'); 3 | const ejs = require('ejs'); 4 | const http = require('http'); 5 | const path = require('path'); 6 | const fs = require('fs'); 7 | 8 | const Window = require('window'); 9 | const window = new Window(); 10 | global.window = window; 11 | global.document = window.document; 12 | 13 | const jsdom = require("jsdom"); 14 | const { JSDOM } = jsdom; 15 | global.DOMParser = new JSDOM().window.DOMParser; 16 | 17 | const {MathpixMarkdownModel} = require('mathpix-markdown-it'); 18 | 19 | const options = { 20 | outMath: { 21 | include_table_html: false, 22 | include_tsv: true, 23 | } 24 | }; 25 | const latex = `\\begin{tabular}{ l c r } 26 | 1 & 2 & 3 \\\\ 27 | 4 & 5 & 6 \\\\ 28 | 7 & 8 & 9 \\\\ 29 | \\end{tabular}`; 30 | const html = MathpixMarkdownModel.markdownToHTML(latex, options); 31 | const parsed = MathpixMarkdownModel.parseMarkdownByHTML(html, false); 32 | 33 | console.log('html=>', html); 34 | console.log('parsed=>', parsed); 35 | -------------------------------------------------------------------------------- /examples/mathpix-markdown-it-node-examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "ejs": "^3.0.1", 13 | "express": "^4.17.1", 14 | "jsdom": "^16.0.0", 15 | "mathpix-markdown-it": "../../../mathpix-markdown-it", 16 | "window": "^4.2.6" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/mathpix-markdown-it-node-examples/views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= site.title %> 6 | 7 | 8 | 9 | 10 | 11 | <%- body %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/nextJS/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/examples/nextJS/app/favicon.ico -------------------------------------------------------------------------------- /examples/nextJS/app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | :root { 6 | --foreground-rgb: 0, 0, 0; 7 | --background-start-rgb: 214, 219, 220; 8 | --background-end-rgb: 255, 255, 255; 9 | } 10 | 11 | @media (prefers-color-scheme: dark) { 12 | :root { 13 | --foreground-rgb: 255, 255, 255; 14 | --background-start-rgb: 0, 0, 0; 15 | --background-end-rgb: 0, 0, 0; 16 | } 17 | } 18 | 19 | body { 20 | color: rgb(var(--foreground-rgb)); 21 | background: linear-gradient( 22 | to bottom, 23 | transparent, 24 | rgb(var(--background-end-rgb)) 25 | ) 26 | rgb(var(--background-start-rgb)); 27 | } 28 | -------------------------------------------------------------------------------- /examples/nextJS/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import { Inter } from "next/font/google"; 3 | import "./globals.css"; 4 | 5 | const inter = Inter({ subsets: ["latin"] }); 6 | 7 | export const metadata: Metadata = { 8 | title: "Create Next App", 9 | description: "Generated by create next app", 10 | }; 11 | 12 | export default function RootLayout({ 13 | children, 14 | }: { 15 | children: React.ReactNode; 16 | }) { 17 | return ( 18 | 19 | {children} 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /examples/nextJS/app/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { MathpixMarkdown, MathpixLoader } from "mathpix-markdown-it"; 4 | import { data } from './data.js'; 5 | 6 | export default function Home() { 7 | return ( 8 |
9 |
10 | 11 | 12 | 13 |
14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /examples/nextJS/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /examples/nextJS/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | module.exports = nextConfig; 5 | -------------------------------------------------------------------------------- /examples/nextJS/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nextjs", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "mathpix-markdown-it": "github:Mathpix/mathpix-markdown-it#dev/olga/update-react-version", 13 | "next": "14.1.0", 14 | "react": "^18", 15 | "react-dom": "^18" 16 | }, 17 | "devDependencies": { 18 | "@types/node": "^20", 19 | "@types/react": "^18", 20 | "@types/react-dom": "^18", 21 | "autoprefixer": "^10.4.17", 22 | "eslint": "^8", 23 | "eslint-config-next": "14.1.0", 24 | "postcss": "^8", 25 | "tailwindcss": "^3.3.0", 26 | "typescript": "^5" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/nextJS/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /examples/nextJS/tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "tailwindcss"; 2 | 3 | const config: Config = { 4 | content: [ 5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}", 6 | "./components/**/*.{js,ts,jsx,tsx,mdx}", 7 | "./app/**/*.{js,ts,jsx,tsx,mdx}", 8 | ], 9 | theme: { 10 | extend: { 11 | backgroundImage: { 12 | "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", 13 | "gradient-conic": 14 | "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", 15 | }, 16 | }, 17 | }, 18 | plugins: [], 19 | }; 20 | export default config; 21 | -------------------------------------------------------------------------------- /examples/nextJS/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /examples/react-app/use-components/.env: -------------------------------------------------------------------------------- 1 | GENERATE_SOURCEMAP=false 2 | -------------------------------------------------------------------------------- /examples/react-app/use-components/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react-app/use-components/README.md: -------------------------------------------------------------------------------- 1 | # mathpix-markdown-it React example 2 | 3 | This repository contains example of how to use mathpix-markdown-it components in your React app. 4 | 5 | ## Install 6 | 7 | Using [npm](https://www.npmjs.com): 8 | 9 | `npm install` 10 | 11 | Using [yarn](https://classic.yarnpkg.com): 12 | 13 | `yarn install` 14 | 15 | ## Start 16 | 17 | Using [npm](https://www.npmjs.com): 18 | 19 | `npm run start` 20 | 21 | Using [yarn](https://classic.yarnpkg.com): 22 | 23 | `yarn start` 24 | 25 | 26 | Runs the app in the development mode.
27 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 28 | 29 | The page will reload if you make edits.
30 | You will also see any lint errors in the console. 31 | -------------------------------------------------------------------------------- /examples/react-app/use-components/craco.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path-browserify'); 2 | 3 | module.exports = { 4 | webpack: { 5 | configure: { 6 | resolve: { 7 | fallback: { 8 | "path": require.resolve("path-browserify") 9 | } 10 | } 11 | } 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /examples/react-app/use-components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "use-components", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@craco/craco": "^7.1.0", 7 | "@testing-library/jest-dom": "^4.2.4", 8 | "@testing-library/react": "^9.3.2", 9 | "@testing-library/user-event": "^7.1.2", 10 | "mathpix-markdown-it": "^2.0.1", 11 | "path-browserify": "^1.0.1", 12 | "react": "^18.2.0", 13 | "react-dom": "^18.2.0", 14 | "react-scripts": "^5.0.1" 15 | }, 16 | "scripts": { 17 | "start": "craco start", 18 | "build": "craco build", 19 | "test": "craco test" 20 | }, 21 | "eslintConfig": { 22 | "extends": "react-app" 23 | }, 24 | "browserslist": { 25 | "production": [ 26 | ">0.2%", 27 | "not dead", 28 | "not op_mini all" 29 | ], 30 | "development": [ 31 | "last 1 chrome version", 32 | "last 1 firefox version", 33 | "last 1 safari version" 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/react-app/use-components/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/examples/react-app/use-components/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-app/use-components/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /examples/react-app/use-components/src/index.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import App from './App'; 4 | const container = document.getElementById('root'); 5 | const root = createRoot(container); 6 | 7 | root.render( 8 | 9 | 10 | , 11 | ); -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/README.md: -------------------------------------------------------------------------------- 1 | This repository contains example of how to use `markdownToHTML()` method in your React app. 2 | 3 | ## Install 4 | 5 | Using [npm](https://www.npmjs.com): 6 | 7 | `npm install` 8 | 9 | Using [yarn](https://classic.yarnpkg.com): 10 | 11 | `yarn install` 12 | 13 | ## Start 14 | 15 | Using [npm](https://www.npmjs.com): 16 | 17 | `npm run start` 18 | 19 | Using [yarn](https://classic.yarnpkg.com): 20 | 21 | `yarn start` 22 | 23 | 24 | Runs the app in the development mode.
25 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 26 | 27 | ![screenshot-localhost_3000-2020 02 04-19_41_12](https://user-images.githubusercontent.com/32493105/73771119-5ece7580-4786-11ea-82c6-eeac6a35ed88.png) 28 | -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "use-markdownToHTML-method", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.3.2", 8 | "@testing-library/user-event": "^7.1.2", 9 | "mathpix-markdown-it": "../../../../mathpix-markdown-it", 10 | "react": "^18.2.0", 11 | "react-dom": "^18.2.0", 12 | "react-scripts": "^5.0.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": "react-app" 22 | }, 23 | "browserslist": { 24 | "production": [ 25 | ">0.2%", 26 | "not dead", 27 | "not op_mini all" 28 | ], 29 | "development": [ 30 | "last 1 chrome version", 31 | "last 1 firefox version", 32 | "last 1 safari version" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/examples/react-app/use-markdownToHTML-method/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/src/App.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import './style.css'; 3 | import {MathpixMarkdownModel as MM} from "mathpix-markdown-it"; 4 | import ConvertForm from "./form"; 5 | 6 | 7 | class App extends React.Component { 8 | componentDidMount() { 9 | const isLoad = MM.loadMathJax(); 10 | if (isLoad) { 11 | console.log('STYLE is loading') 12 | } else { 13 | console.log('STYLE is NOT loading') 14 | } 15 | } 16 | render() { 17 | return ( 18 |
19 | 20 |
21 | ) 22 | } 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/src/index.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import App from './App'; 4 | const container = document.getElementById('root'); 5 | const root = createRoot(container); 6 | 7 | root.render( 8 | 9 | 10 | , 11 | ); -------------------------------------------------------------------------------- /examples/react-app/use-markdownToHTML-method/src/style.css: -------------------------------------------------------------------------------- 1 | .App { 2 | width: 800px; 3 | margin: auto; 4 | } 5 | 6 | #preview-content { 7 | min-height: 200px; 8 | border: 1px solid gray; 9 | margin-top: 20px; 10 | padding: 10px; 11 | } 12 | 13 | textarea { 14 | min-height: 200px; 15 | width: 100%; 16 | } 17 | -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/README.md: -------------------------------------------------------------------------------- 1 | This repository contains example of how to use `parseMarkdownByHTML()` method in your React app. 2 | 3 | 4 | ## Install 5 | 6 | Using [npm](https://www.npmjs.com): 7 | 8 | `npm install` 9 | 10 | Using [yarn](https://classic.yarnpkg.com): 11 | 12 | `yarn install` 13 | 14 | ## Start 15 | 16 | Using [npm](https://www.npmjs.com): 17 | 18 | `npm run start` 19 | 20 | Using [yarn](https://classic.yarnpkg.com): 21 | 22 | `yarn start` 23 | 24 | 25 | Runs the app in the development mode.
26 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 27 | 28 | 29 | ![ezgif com-video-to-gif (61)](https://user-images.githubusercontent.com/32493105/75344782-03cf0080-58a4-11ea-81a9-c0a1b6162aa3.gif) 30 | -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "use-parseMarkdownByHTML-methods", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.3.2", 8 | "@testing-library/user-event": "^7.1.2", 9 | "mathpix-markdown-it": "../../../../mathpix-markdown-it", 10 | "react": "^18.2.0", 11 | "react-dom": "^18.2.0", 12 | "react-scripts": "^5.0.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": "react-app" 22 | }, 23 | "browserslist": { 24 | "production": [ 25 | ">0.2%", 26 | "not dead", 27 | "not op_mini all" 28 | ], 29 | "development": [ 30 | "last 1 chrome version", 31 | "last 1 firefox version", 32 | "last 1 safari version" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/examples/react-app/use-parseMarkdownByHTML-method/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/src/App.jsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import './style.css'; 3 | import {MathpixMarkdownModel as MM} from "mathpix-markdown-it"; 4 | import ConvertForm from "./form"; 5 | 6 | class App extends React.Component { 7 | componentDidMount() { 8 | const isLoad = MM.loadMathJax(); 9 | if (isLoad) { 10 | console.log('STYLE is loading') 11 | } else { 12 | console.log('STYLE is NOT loading') 13 | } 14 | } 15 | render() { 16 | return ( 17 |
18 | 19 |
20 | ) 21 | } 22 | } 23 | 24 | export default App; 25 | -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/src/index.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import App from './App'; 4 | const container = document.getElementById('root'); 5 | const root = createRoot(container); 6 | 7 | root.render( 8 | 9 | 10 | , 11 | ); 12 | 13 | -------------------------------------------------------------------------------- /examples/react-app/use-parseMarkdownByHTML-method/src/style.css: -------------------------------------------------------------------------------- 1 | .App { 2 | width: 800px; 3 | margin: auto; 4 | } 5 | 6 | #preview-content { 7 | min-height: 100px; 8 | border: 1px solid gray; 9 | margin-top: 20px; 10 | padding: 10px; 11 | } 12 | 13 | .inputs { 14 | display: flex; 15 | } 16 | 17 | .includes { 18 | width: 100px; 19 | margin-left: 20px; 20 | } 21 | 22 | .includes label { 23 | display: block; 24 | margin-bottom: 10px; 25 | } 26 | 27 | textarea { 28 | min-height: 100px; 29 | width: 100%; 30 | } 31 | 32 | .formats { 33 | margin-top: 20px; 34 | } 35 | 36 | code { 37 | font-family: Inconsolata; 38 | background: #f8f8fa; 39 | display: block; 40 | color: #333; 41 | overflow-x: auto; 42 | font-size: 15px; 43 | margin-bottom: 1em; 44 | border: 1px solid #ccc; 45 | page-break-inside: avoid; 46 | padding: 0.5em; 47 | max-height: 100px; 48 | word-wrap: break-word; 49 | white-space: pre-wrap; 50 | } 51 | -------------------------------------------------------------------------------- /examples/react-app/use-render-method/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react-app/use-render-method/README.md: -------------------------------------------------------------------------------- 1 | This repository contains example of how to use 2 | `getMathpixFontsStyle()`, `getMathpixStyle(true)` and `render()` methods by MathpixMarkdownModel in your React app. 3 | 4 | ## Install 5 | 6 | Using [npm](https://www.npmjs.com): 7 | 8 | `npm install` 9 | 10 | Using [yarn](https://classic.yarnpkg.com): 11 | 12 | `yarn install` 13 | 14 | ## Start 15 | 16 | Using [npm](https://www.npmjs.com): 17 | 18 | `npm run start` 19 | 20 | Using [yarn](https://classic.yarnpkg.com): 21 | 22 | `yarn start` 23 | 24 | 25 | Runs the app in the development mode.
26 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 27 | 28 | ![screenshot-localhost_3000-2020 02 04-19_37_35](https://user-images.githubusercontent.com/32493105/73770872-dc45b600-4785-11ea-9c1f-a3bbd3707a70.png) 29 | -------------------------------------------------------------------------------- /examples/react-app/use-render-method/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "use-render-methods", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.3.2", 8 | "@testing-library/user-event": "^7.1.2", 9 | "mathpix-markdown-it": "../../../../mathpix-markdown-it", 10 | "react": "^18.2.0", 11 | "react-dom": "^18.2.0", 12 | "react-scripts": "^5.0.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": "react-app" 22 | }, 23 | "browserslist": { 24 | "production": [ 25 | ">0.2%", 26 | "not dead", 27 | "not op_mini all" 28 | ], 29 | "development": [ 30 | "last 1 chrome version", 31 | "last 1 firefox version", 32 | "last 1 safari version" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/react-app/use-render-method/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/examples/react-app/use-render-method/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-app/use-render-method/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /examples/react-app/use-render-method/src/App.jsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { MathpixMarkdownModel as MM } from 'mathpix-markdown-it'; 3 | import { data } from './data.js'; 4 | import './style.css'; 5 | 6 | class App extends React.Component { 7 | componentDidMount() { 8 | const elStyle = document.getElementById('Mathpix-styles'); 9 | if (!elStyle) { 10 | const style = document.createElement("style"); 11 | style.setAttribute("id", "Mathpix-styles"); 12 | style.innerHTML = MM.getMathpixFontsStyle() + MM.getMathpixStyle(true); 13 | document.head.appendChild(style); 14 | } 15 | } 16 | render() { 17 | const html = MM.render(data, {htmlTags: true}); 18 | return ( 19 |
20 |
21 |
22 | ) 23 | } 24 | } 25 | 26 | export default App; 27 | -------------------------------------------------------------------------------- /examples/react-app/use-render-method/src/index.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import App from './App'; 4 | const container = document.getElementById('root'); 5 | const root = createRoot(container); 6 | 7 | root.render( 8 | 9 | 10 | , 11 | ); 12 | 13 | -------------------------------------------------------------------------------- /examples/react-app/use-render-method/src/style.css: -------------------------------------------------------------------------------- 1 | .App { 2 | width: 800px; 3 | margin: auto; 4 | } 5 | -------------------------------------------------------------------------------- /examples/react-app/use-toc/.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | -------------------------------------------------------------------------------- /examples/react-app/use-toc/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/react-app/use-toc/README.md: -------------------------------------------------------------------------------- 1 | This repository contains example of how to use `getTocContainerHTML()` method in your React app. 2 | 3 | 4 | 5 | ## Install 6 | 7 | Using [npm](https://www.npmjs.com): 8 | 9 | `npm install` 10 | 11 | Using [yarn](https://classic.yarnpkg.com): 12 | 13 | `yarn install` 14 | 15 | ## Start 16 | 17 | Using [npm](https://www.npmjs.com): 18 | 19 | `npm run start` 20 | 21 | Using [yarn](https://classic.yarnpkg.com): 22 | 23 | `yarn start` 24 | 25 | 26 | Runs the app in the development mode.
27 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 28 | 29 | 30 | ![example-toc.gif](./example-toc.gif) 31 | -------------------------------------------------------------------------------- /examples/react-app/use-toc/example-toc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/examples/react-app/use-toc/example-toc.gif -------------------------------------------------------------------------------- /examples/react-app/use-toc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "use-toc", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.3.2", 8 | "@testing-library/user-event": "^7.1.2", 9 | "mathpix-markdown-it": "../../../../mathpix-markdown-it", 10 | "react": "^18.2.0", 11 | "react-dom": "^18.2.0", 12 | "react-scripts": "^5.0.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": "react-app" 22 | }, 23 | "browserslist": { 24 | "production": [ 25 | ">0.2%", 26 | "not dead", 27 | "not op_mini all" 28 | ], 29 | "development": [ 30 | "last 1 chrome version", 31 | "last 1 firefox version", 32 | "last 1 safari version" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/react-app/use-toc/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/examples/react-app/use-toc/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-app/use-toc/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /examples/react-app/use-toc/src/App.jsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import './style.css'; 3 | import { MathpixMarkdownModel as MM } from "mathpix-markdown-it"; 4 | import ConvertForm from "./form"; 5 | 6 | class App extends React.Component { 7 | componentDidMount() { 8 | const isLoad = MM.loadMathJax(true, true, 'toc'); 9 | if (isLoad) { 10 | console.log('STYLE is loading') 11 | } else { 12 | console.log('STYLE is NOT loading') 13 | } 14 | } 15 | render() { 16 | return ( 17 |
18 | 19 |
20 | ) 21 | } 22 | } 23 | 24 | export default App; 25 | -------------------------------------------------------------------------------- /examples/react-app/use-toc/src/index.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import App from './App'; 4 | const container = document.getElementById('root'); 5 | const root = createRoot(container); 6 | 7 | root.render( 8 | 9 | 10 | , 11 | ); -------------------------------------------------------------------------------- /lib/bundle.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | loadMathJax: Function; 4 | markdownToHTML: Function; 5 | render: Function; 6 | mmdYamlToHTML: Function; 7 | renderTitleMmd: Function; 8 | renderAuthorsMmd: Function; 9 | } 10 | } 11 | export declare const exportMethods: () => void; 12 | -------------------------------------------------------------------------------- /lib/bundle.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.exportMethods = void 0; 4 | var mathpix_markdown_model_1 = require("./mathpix-markdown-model"); 5 | var exportMethods = function () { 6 | window.loadMathJax = mathpix_markdown_model_1.MathpixMarkdownModel.loadMathJax; 7 | window.render = mathpix_markdown_model_1.MathpixMarkdownModel.render; 8 | window.markdownToHTML = mathpix_markdown_model_1.MathpixMarkdownModel.markdownToHTML; 9 | window.mmdYamlToHTML = mathpix_markdown_model_1.MathpixMarkdownModel.mmdYamlToHTML; 10 | window.renderTitleMmd = mathpix_markdown_model_1.MathpixMarkdownModel.renderTitleMmd; 11 | window.renderAuthorsMmd = mathpix_markdown_model_1.MathpixMarkdownModel.renderAuthorsMmd; 12 | }; 13 | exports.exportMethods = exportMethods; 14 | (0, exports.exportMethods)(); 15 | //# sourceMappingURL=bundle.js.map -------------------------------------------------------------------------------- /lib/bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.tsx"],"names":[],"mappings":";;;AAAA,mEAAsE;AAa/D,IAAM,aAAa,GAAG;IAC3B,MAAM,CAAC,WAAW,GAAG,6CAAE,CAAC,WAAW,CAAC;IACpC,MAAM,CAAC,MAAM,GAAG,6CAAE,CAAC,MAAM,CAAC;IAC1B,MAAM,CAAC,cAAc,GAAG,6CAAE,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,aAAa,GAAG,6CAAE,CAAC,aAAa,CAAC;IACxC,MAAM,CAAC,cAAc,GAAG,6CAAE,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,gBAAgB,GAAG,6CAAE,CAAC,gBAAgB,CAAC;AAChD,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB;AAEF,IAAA,qBAAa,GAAE,CAAC"} -------------------------------------------------------------------------------- /lib/components/mathpix-loader/index.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | export interface PMathpixLoader { 3 | children: React.ReactNode; 4 | notScrolling?: boolean; 5 | textAlignJustify?: boolean; 6 | } 7 | declare class MathpixLoader extends React.Component { 8 | /** the state of the component */ 9 | state: { 10 | isReadyToTypeSet: boolean; 11 | }; 12 | componentDidMount(): void; 13 | render(): React.JSX.Element; 14 | } 15 | export default MathpixLoader; 16 | -------------------------------------------------------------------------------- /lib/components/mathpix-loader/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/mathpix-loader/index.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,uEAAuE;AAQvE;IAA4B,yCAA+B;IAA3D;QAAA,qEAiBC;QAhBG,iCAAiC;QACjC,WAAK,GAAG;YACJ,gBAAgB,EAAE,KAAK;SAC1B,CAAC;;IAaN,CAAC;IAXG,yCAAiB,GAAjB;QACU,IAAA,KAAoD,IAAI,CAAC,KAAK,EAA7D,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA,EAAE,wBAAwB,EAAxB,gBAAgB,mBAAG,KAAK,KAAe,CAAC;QACrE,IAAM,MAAM,GAAG,6CAAE,CAAC,WAAW,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,EAAC,gBAAgB,EAAE,MAAM,EAAC,CAAC,CAAC;IAC9C,CAAC;IACD,8BAAM,GAAN;QACI,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;YAC7B,OAAO,6BAAK,EAAE,EAAC,SAAS,IAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAO,CAAA;SACvD;QACD,OAAO,2CAAkB,CAAC;IAC9B,CAAC;IACL,oBAAC;AAAD,CAAC,AAjBD,CAA4B,KAAK,CAAC,SAAS,GAiB1C;AAED,kBAAe,aAAa,CAAC"} -------------------------------------------------------------------------------- /lib/components/mathpix-markdown/index.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { optionsMathpixMarkdown } from '../../mathpix-markdown-model'; 3 | export interface MathpixMarkdownProps extends optionsMathpixMarkdown { 4 | text: string; 5 | } 6 | declare class MathpixMarkdown extends React.Component { 7 | render(): React.JSX.Element; 8 | } 9 | export default MathpixMarkdown; 10 | -------------------------------------------------------------------------------- /lib/contex-menu/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare const handleTouchStart: (e: any) => void; 2 | export declare const handleClick: (e: any) => void; 3 | export declare const handleKeyUp: (e: any) => void; 4 | export declare const handleResize: () => void; 5 | export declare const addContextMenuListener: () => void; 6 | export declare const removeContextMenuListener: () => void; 7 | export declare const addClickListener: () => void; 8 | export declare const removeClickListener: () => void; 9 | export declare const addKeyUpListener: () => void; 10 | export declare const removeKeyUpListener: () => void; 11 | export declare const addResizeListener: () => void; 12 | export declare const removeResizeListener: () => void; 13 | export declare const addTouchStartListener: () => void; 14 | export declare const removeTouchStartListener: () => void; 15 | export declare const addListenerContextMenuEvents: () => void; 16 | export declare const removeListenerContextMenuEvents: () => void; 17 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/consts.d.ts: -------------------------------------------------------------------------------- 1 | export declare const classNameContextMenu = "mmd-context-menu"; 2 | export declare const classNameMenu = "mmd-menu"; 3 | export declare const classNameMenuItem = "mmd-menu-item"; 4 | export declare const classNameMenuItemSource = "mmd-menu-item-source"; 5 | export declare const SMALL_SCREEN_BREAKPOINT = 580; 6 | export declare const heightMenuItem = 52; 7 | export declare const paddingMenu = 5; 8 | export declare const paddingMenuBottomSmall = 34; 9 | export declare const maxWidthMenu = 320; 10 | export declare const mathExportTypes: string[]; 11 | /** Classes mmd for which the context menu is supported */ 12 | export declare const mmdClassesForContextMenu: string[]; 13 | export declare enum eMathType { 14 | latex = "latex", 15 | asciimath = "asciimath", 16 | mathml = "mathml", 17 | mathmlword = "mathmlword", 18 | tsv = "tsv", 19 | csv = "csv", 20 | table_markdown = "table-markdown", 21 | smiles = "smiles" 22 | } 23 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/consts.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../src/contex-menu/menu/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,kBAAkB,CAAC;AAC1C,QAAA,aAAa,GAAG,UAAU,CAAC;AAC3B,QAAA,iBAAiB,GAAG,eAAe,CAAC;AACpC,QAAA,uBAAuB,GAAG,sBAAsB,CAAC;AACjD,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAE9B,QAAA,cAAc,GAAG,EAAE,CAAC;AACpB,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAC5B,QAAA,YAAY,GAAG,GAAG,CAAC;AAEnB,QAAA,eAAe,GAAG;IAC7B,OAAO;IACP,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,KAAK;IACL,KAAK;IACL,gBAAgB;IAChB,QAAQ;CACT,CAAC;AAEF,0DAA0D;AAC7C,QAAA,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;AAEjG,IAAY,SASX;AATD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,oCAAuB,CAAA;IACvB,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,wBAAW,CAAA;IACX,wBAAW,CAAA;IACX,8CAAiC,CAAA;IACjC,8BAAiB,CAAA;AACnB,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB"} -------------------------------------------------------------------------------- /lib/contex-menu/menu/helper.d.ts: -------------------------------------------------------------------------------- 1 | import { IMenuPosition } from "./interfaces"; 2 | export declare const getPosition: (e: any) => { 3 | x: number; 4 | y: number; 5 | }; 6 | export declare const getMenuElement: () => Element; 7 | export declare const getContextMenuElement: () => Element; 8 | export declare const positionMenu: (e: any) => void; 9 | export declare const getPositionMenuByClick: (e: any, itemsLength: any) => IMenuPosition; 10 | export declare const findClassInElement: (el: any, classNamesList: any) => string; 11 | export declare const clickInsideElement: (e: any, classNamesList: any, isMenuItem?: boolean) => any; 12 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare const createContextMenu: (el: any, e: any) => void; 2 | export declare const dropContextMenu: (elContextMenu?: any) => void; 3 | export declare const isOpenContextMenu: () => boolean; 4 | export declare const toggleMenuOn: (el: any, e: any) => void; 5 | export declare const toggleMenuOff: () => void; 6 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/interfaces.d.ts: -------------------------------------------------------------------------------- 1 | export interface IMenuPosition { 2 | left?: string; 3 | top?: string; 4 | maxWidth?: string; 5 | className?: string; 6 | } 7 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/interfaces.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=interfaces.js.map -------------------------------------------------------------------------------- /lib/contex-menu/menu/interfaces.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/contex-menu/menu/interfaces.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /lib/contex-menu/menu/menu-item-actions.d.ts: -------------------------------------------------------------------------------- 1 | export declare const getMenuItems: () => NodeListOf; 2 | export declare const getMenuItemActive: () => Element; 3 | export declare const findIndexActiveItem: (elem: any, items?: any) => number; 4 | export declare const clearActiveItem: () => void; 5 | export declare const chooseItem: (el: any) => void; 6 | export declare const chooseNextItem: () => void; 7 | export declare const choosePreviousItem: () => void; 8 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/menu-item.d.ts: -------------------------------------------------------------------------------- 1 | export declare const createMathMenuItem: (type: any, value: string) => HTMLDivElement; 2 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/menu-items.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mathMenuItems: (el: any) => any[]; 2 | -------------------------------------------------------------------------------- /lib/contex-menu/menu/menu-items.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"menu-items.js","sourceRoot":"","sources":["../../../src/contex-menu/menu/menu-items.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAC3C,yCAAiD;AACjD,qEAAkE;AAE3D,IAAM,aAAa,GAAG,UAAC,EAAE;IAC9B,IAAM,KAAK,GAAG,EAAE,CAAC;IACjB,IAAI;QACF,IAAM,GAAG,GAAG,IAAA,mCAAe,EAAC,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;gCAEQ,CAAC;YACR,IAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,IAAI,KAAK,wBAAe,CAAC,CAAC,CAAC,EAAhC,CAAgC,CAAC,CAAC;YACnE,IAAI,CAAC,OAAO,EAAE;;aAEb;YAED,IAAI,IAAI,GAAG,IAAA,8BAAkB,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;YAC3D,IAAI,IAAI,EAAE;gBACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAClB;;QATH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,wBAAe,CAAC,MAAM,EAAE,CAAC,EAAE;oBAAtC,CAAC;SAUT;QAED,OAAO,KAAK,CAAC;KACd;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CAAC;AAzBW,QAAA,aAAa,iBAyBxB"} -------------------------------------------------------------------------------- /lib/contex-menu/styles.d.ts: -------------------------------------------------------------------------------- 1 | export declare const menuStyle: () => string; 2 | -------------------------------------------------------------------------------- /lib/contex-menu/styles.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/contex-menu/styles.ts"],"names":[],"mappings":";;;AAAA,wCAAkG;AAE3F,IAAM,SAAS,GAAG;IACvB,OAAO,0CAEQ,qBAAY,2HAKd,oBAAW,mwBA6BJ,+BAAsB,2eAuB9B,uBAAc,kCACV,uBAAc,i8BA+C7B,CAAA;AACH,CAAC,CAAC;AA7GW,QAAA,SAAS,aA6GpB"} -------------------------------------------------------------------------------- /lib/context-menu.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | addListenerContextMenuEvents: Function; 4 | removeListenerContextMenuEvents: Function; 5 | } 6 | } 7 | export declare const exportMethods: () => void; 8 | -------------------------------------------------------------------------------- /lib/context-menu.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.exportMethods = void 0; 4 | var contex_menu_1 = require("./contex-menu"); 5 | var exportMethods = function () { 6 | window.addListenerContextMenuEvents = contex_menu_1.addListenerContextMenuEvents; 7 | window.removeListenerContextMenuEvents = contex_menu_1.removeListenerContextMenuEvents; 8 | }; 9 | exports.exportMethods = exportMethods; 10 | (0, exports.exportMethods)(); 11 | //# sourceMappingURL=context-menu.js.map -------------------------------------------------------------------------------- /lib/context-menu.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":";;;AAAA,6CAA8F;AASvF,IAAM,aAAa,GAAG;IAC3B,MAAM,CAAC,4BAA4B,GAAG,0CAA4B,CAAC;IACnE,MAAM,CAAC,+BAA+B,GAAG,6CAA+B,CAAC;AAC3E,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB;AAEF,IAAA,qBAAa,GAAE,CAAC"} -------------------------------------------------------------------------------- /lib/copy-to-clipboard/clipboard-copy-element.d.ts: -------------------------------------------------------------------------------- 1 | export declare const clipboardCopyElement: (value: string) => string; 2 | -------------------------------------------------------------------------------- /lib/copy-to-clipboard/clipboard-copy-element.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"clipboard-copy-element.js","sourceRoot":"","sources":["../../src/copy-to-clipboard/clipboard-copy-element.ts"],"names":[],"mappings":";;;AAAA,IAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC,UAAU,CAAC;AAEtE,IAAM,iBAAiB,GAAG,8GAA8G;IACtI,+EAA+E;IAC/E,wdAAwd;IACxd,QAAQ,CAAC;AACX,IAAM,kBAAkB,GAAG,8GAA8G;IACvI,+FAA+F;IAC/F,4LAA4L;IAC5L,QAAQ,CAAC;AAEJ,IAAM,oBAAoB,GAAG,UAAC,KAAa;IAChD,IAAI,IAAI,GAAG,0FAA0F,CAAC;IACtG,IAAI,IAAK,+GAA+G,CAAC;IACzH,IAAI,IAAI,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAC7C,IAAI,IAAI,iBAAiB,CAAC;IAC1B,IAAI,IAAI,kBAAkB,CAAC;IAC3B,IAAI,IAAI,mBAAmB,CAAC;IAC5B,IAAI,IAAI,QAAQ,CAAC;IACjB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AATW,QAAA,oBAAoB,wBAS/B"} -------------------------------------------------------------------------------- /lib/copy-to-clipboard/clipboard-copy-styles.d.ts: -------------------------------------------------------------------------------- 1 | export declare const clipboardCopyStyles: () => string; 2 | -------------------------------------------------------------------------------- /lib/copy-to-clipboard/clipboard-copy-styles.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"clipboard-copy-styles.js","sourceRoot":"","sources":["../../src/copy-to-clipboard/clipboard-copy-styles.ts"],"names":[],"mappings":";;;AAAO,IAAM,mBAAmB,GAAG,cAAM,OAAA,gqEAkGxC,EAlGwC,CAkGxC,CAAC;AAlGW,QAAA,mBAAmB,uBAkG9B"} -------------------------------------------------------------------------------- /lib/copy-to-clipboard/clipboard.d.ts: -------------------------------------------------------------------------------- 1 | export declare function copyNode(node: Element): Promise; 2 | export declare function copyText(text: string): Promise; 3 | -------------------------------------------------------------------------------- /lib/copy-to-clipboard/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare const clickInsideCopyElement: (e: any) => any; 2 | export declare const clicked: (event: any) => void; 3 | export declare const focused: (event: FocusEvent) => void; 4 | export declare const blurred: () => void; 5 | export declare const addListenerCopyToClipdoardEvents: () => void; 6 | export declare const removeListenerCopyToClipdoardEvents: () => void; 7 | -------------------------------------------------------------------------------- /lib/helpers/consts.d.ts: -------------------------------------------------------------------------------- 1 | export declare const envArraysShouldBeFlattenInTSV: string[]; 2 | -------------------------------------------------------------------------------- /lib/helpers/consts.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.envArraysShouldBeFlattenInTSV = void 0; 4 | exports.envArraysShouldBeFlattenInTSV = ["array", "gathered", "aligned"]; 5 | //# sourceMappingURL=consts.js.map -------------------------------------------------------------------------------- /lib/helpers/consts.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/helpers/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,6BAA6B,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC"} -------------------------------------------------------------------------------- /lib/helpers/icons/css-colors.d.ts: -------------------------------------------------------------------------------- 1 | export declare const cssColors: string[]; 2 | -------------------------------------------------------------------------------- /lib/helpers/icons/emoji-icons.d.ts: -------------------------------------------------------------------------------- 1 | import { IUnicodeIcon } from "."; 2 | export declare const emojiIcons: Array; 3 | -------------------------------------------------------------------------------- /lib/helpers/icons/fa-icons.d.ts: -------------------------------------------------------------------------------- 1 | import { IUnicodeIcon } from "."; 2 | export declare const faIcons: Array; 3 | -------------------------------------------------------------------------------- /lib/helpers/icons/icons.d.ts: -------------------------------------------------------------------------------- 1 | export declare const icons: { 2 | symbol: string; 3 | unicodeHex: string; 4 | code: number; 5 | alias: string; 6 | name: string; 7 | nameUnicode: string; 8 | }[]; 9 | export declare const squaredIcons: { 10 | symbol: string; 11 | alias: string; 12 | name: string; 13 | }[]; 14 | export declare const findIcon: (iconName: string, isMath?: boolean) => any; 15 | export declare const findSquaredIcon: (iconName: string) => { 16 | symbol: string; 17 | alias: string; 18 | name: string; 19 | }; 20 | export declare const findFaIcons: (iconName: string) => { 21 | alias: string; 22 | name: string; 23 | symbol: string; 24 | }; 25 | -------------------------------------------------------------------------------- /lib/helpers/icons/index.d.ts: -------------------------------------------------------------------------------- 1 | export interface IUnicodeIcon { 2 | symbol: string; 3 | unicodeHex?: string; 4 | code?: number; 5 | alias?: string; 6 | name?: string; 7 | nameUnicode?: string; 8 | width?: string; 9 | textOnly?: boolean; 10 | tags?: Array; 11 | } 12 | export interface IIcon { 13 | icon: IUnicodeIcon; 14 | name?: string; 15 | color?: string; 16 | isSquared?: boolean; 17 | } 18 | export declare const findSquaredIcon: (iconName: string) => IUnicodeIcon; 19 | export declare const findSquaredIconByName: (iconName: string) => IUnicodeIcon; 20 | export declare const findSquaredIconByTag: (tag: string) => IUnicodeIcon; 21 | export declare const findFaIconsByName: (iconName: string) => IUnicodeIcon; 22 | export declare const findFaIconsByTag: (tag: string) => IUnicodeIcon; 23 | export declare const findIcon: (iconName: string, isMath?: boolean) => IIcon; 24 | -------------------------------------------------------------------------------- /lib/helpers/icons/squared-icons.d.ts: -------------------------------------------------------------------------------- 1 | import { IUnicodeIcon } from "./index"; 2 | export declare const squaredIcons: Array; 3 | -------------------------------------------------------------------------------- /lib/helpers/icons/squared-icons.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.squaredIcons = void 0; 4 | exports.squaredIcons = [ 5 | { symbol: "1", alias: "squared_one", name: "squared_digit_one", tags: ["color_squared_one"] }, 6 | { symbol: "2", alias: "squared_two", name: "squared_digit_two", tags: ["color_squared_two"] }, 7 | { symbol: "3", alias: "squared_three", name: "squared_digit_three", tags: ["color_squared_three"] }, 8 | { symbol: "4", alias: "squared_four", name: "squared_digit_four", tags: ["color_squared_four"] }, 9 | { symbol: "5", alias: "squared_five", name: "squared_digit_five", tags: ["color_squared_five"] }, 10 | { symbol: "6", alias: "squared_six", name: "squared_digit_six", tags: ["color_squared_six"] }, 11 | { symbol: "7", alias: "squared_seven", name: "squared_digit_seven", tags: ["color_squared_seven"] }, 12 | { symbol: "8", alias: "squared_eight", name: "squared_digit_eight", tags: ["color_squared_eight"] }, 13 | { symbol: "9", alias: "squared_nine", name: "squared_digit_nine", tags: ["color_squared_nine"] }, 14 | { symbol: "0", alias: "squared_zero", name: "squared_digit_zero", tags: ["color_squared_zero"] }, 15 | ]; 16 | //# sourceMappingURL=squared-icons.js.map -------------------------------------------------------------------------------- /lib/helpers/icons/squared-icons.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"squared-icons.js","sourceRoot":"","sources":["../../../src/helpers/icons/squared-icons.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAwB;IAC/C,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE;IAC7F,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE;IAC7F,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,qBAAqB,CAAC,EAAE;IACnG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE;IAChG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE;IAChG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE;IAC7F,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,qBAAqB,CAAC,EAAE;IACnG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,qBAAqB,CAAC,EAAE;IACnG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE;IAChG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE;CACjG,CAAC"} -------------------------------------------------------------------------------- /lib/helpers/icons/unicode-icons.d.ts: -------------------------------------------------------------------------------- 1 | import { IUnicodeIcon } from "."; 2 | export declare const unicodeIcons: Array; 3 | -------------------------------------------------------------------------------- /lib/helpers/normalize-link.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * normalizeLink(url) -> String 3 | * 4 | * Function used to encode link url to a machine-readable format, 5 | * which includes url-encoding, punycode, etc. 6 | **/ 7 | export declare const normalizeLink: (url: any) => any; 8 | -------------------------------------------------------------------------------- /lib/helpers/normalize-link.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"normalize-link.js","sourceRoot":"","sources":["../../src/helpers/normalize-link.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,mCAAqC;AACrC,IAAM,mBAAmB,GAAG,CAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAE,CAAC;AAE7D;;;;;IAKI;AACG,IAAM,aAAa,GAAG,UAAC,GAAG;IAC/B,IAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEtC,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,iCAAiC;QACjC,iEAAiE;QACjE,EAAE;QACF,sEAAsE;QACtE,qEAAqE;QACrE,EAAE;QACF,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACzE,IAAI;gBACF,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;aACrD;YAAC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE;SACtB;KACF;IAED,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB"} -------------------------------------------------------------------------------- /lib/helpers/parse-mmd-element.d.ts: -------------------------------------------------------------------------------- 1 | export declare const formatSourceHtml: (text: string, notTrim?: boolean) => string; 2 | export declare const formatSourceHtmlWord: (text: string, notTrim?: boolean) => string; 3 | export declare const formatSource: (text: string, notTrim?: boolean) => string; 4 | export declare const formatSourceMML: (text: string) => string; 5 | export declare const parseMmdElement: (math_el: any, res?: any[]) => any[]; 6 | export declare const parseMarkdownByElement: (el: HTMLElement | Document, include_sub_math?: boolean) => any[]; 7 | -------------------------------------------------------------------------------- /lib/helpers/parze_link_destination.d.ts: -------------------------------------------------------------------------------- 1 | export declare function parseLinkDestination(str: any, pos: any, max: any): { 2 | ok: boolean; 3 | pos: number; 4 | lines: number; 5 | str: string; 6 | }; 7 | -------------------------------------------------------------------------------- /lib/helpers/utils.d.ts: -------------------------------------------------------------------------------- 1 | export declare const formatMathJaxError: (err: any, latex: any, fName?: string) => void; 2 | -------------------------------------------------------------------------------- /lib/helpers/utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":";;;AAAO,IAAM,kBAAkB,GAAG,UAAC,GAAG,EAAE,KAAK,EAAE,KAAiB;IAAjB,sBAAA,EAAA,iBAAiB;IAC9D,IAAI;QACF,IAAM,UAAU,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC;QAE5E,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE;YAC3C,IAAM,YAAY,GAAG,GAAG,CAAC,OAAO,IAAI,eAAe,CAAC;YACpD,IAAM,SAAS,GAAG;gBAChB,OAAO,EAAE,YAAY;gBACrB,KAAK,EAAE,UAAU;aAClB,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,WAAI,KAAK,cAAW,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;SACvE;aAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAClC,OAAO,CAAC,GAAG,CAAC,WAAI,KAAK,uBAAa,GAAG,CAAE,EAAE,mBAAY,UAAU,CAAE,CAAC,CAAC;SACpE;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,WAAI,KAAK,oCAAiC,EAAE,GAAG,EAAE,mBAAY,UAAU,CAAE,CAAC,CAAC;SACxF;KACF;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,WAAI,KAAK,iCAA8B,EAAE,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,WAAI,KAAK,uBAAoB,EAAE,GAAG,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,WAAI,KAAK,uBAAa,KAAK,CAAE,CAAC,CAAC;KAC5C;AACH,CAAC,CAAC;AArBW,QAAA,kBAAkB,sBAqB7B"} -------------------------------------------------------------------------------- /lib/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;AAAA,8DAAwD;AAkDtD,wBAlDK,wBAAa,CAkDL;AAjDf,kEAA4D;AAiD3C,0BAjDV,0BAAe,CAiDU;AAhDhC,gFAEmE;AA+CjE,sGAhDA,gDAAqB,OAgDA;AAGrB,oGAlDA,8CAAmB,OAkDA;AAhDrB,oEAYuC;AAqCrC,gGAhDA,oCAAe,OAgDA;AAAE,sGA/CjB,0CAAqB,OA+CiB;AAAE,6FA9CxC,iCAAY,OA8CwC;AAAE,4FA7CtD,gCAAW,OA6CsD;AAAE,+FA5CnE,mCAAc,OA4CmE;AAAE,qGA3CnF,yCAAoB,OA2CmF;AAAE,6FA1CzG,iCAAY,OA0CyG;AAAE,kGAzCvH,sCAAiB,OAyCuH;AAJjH,oGApCvB,wCAAmB,OAoCuB;AAC1C,iGApCA,qCAAgB,OAoCA;AAChB,2GApCA,+CAA0B,OAoCA;AAjC5B,mEAakC;AAiBA,qGA7BhC,6CAAoB,OA6BgC;AAUpD,0FAjCA,kCAAS,OAiCA;AAGT,6FAlCA,qCAAY,OAkCA;AA3Bd,uDAAwE;AAsBtE,yGAtBO,iCAAwB,OAsBP;AArB1B,6DAA8E;AAsB5E,wGAtBO,+BAAuB,OAsBP;AApBzB,mDAMkC;AAoBhC,2FAzBA,mBAAU,OAyBA;AAAU,8FAvBpB,sBAAa,OAuBoB;AAAE,4GAtBnC,oCAA2B,OAsBmC;AAAE,gGArBhE,wBAAe,OAqBgE;AAlBjF,2DAAyD;AAmBvD,8FAnBO,8BAAa,OAmBP"} -------------------------------------------------------------------------------- /lib/markdown/common/convert-math-to-html.d.ts: -------------------------------------------------------------------------------- 1 | /** Perform math to conversion to html and get additional data from MathJax to pass it to render rules */ 2 | export declare const convertMathToHtml: (state: any, token: any, options: any) => any; 3 | -------------------------------------------------------------------------------- /lib/markdown/common/counters.d.ts: -------------------------------------------------------------------------------- 1 | export interface ISize { 2 | widthEx: number; 3 | heightEx: number; 4 | } 5 | export declare let size: ISize; 6 | export declare const resetSizeCounter: () => void; 7 | export declare const setSizeCounter: (widthEx: number, heightEx: number) => void; 8 | -------------------------------------------------------------------------------- /lib/markdown/common/counters.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.setSizeCounter = exports.resetSizeCounter = exports.size = void 0; 4 | exports.size = { 5 | heightEx: 0, 6 | widthEx: 0 7 | }; 8 | var resetSizeCounter = function () { 9 | exports.size = { 10 | heightEx: 0, 11 | widthEx: 0 12 | }; 13 | }; 14 | exports.resetSizeCounter = resetSizeCounter; 15 | var setSizeCounter = function (widthEx, heightEx) { 16 | exports.size.widthEx += widthEx; 17 | exports.size.heightEx += heightEx; 18 | }; 19 | exports.setSizeCounter = setSizeCounter; 20 | //# sourceMappingURL=counters.js.map -------------------------------------------------------------------------------- /lib/markdown/common/counters.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"counters.js","sourceRoot":"","sources":["../../../src/markdown/common/counters.ts"],"names":[],"mappings":";;;AAKW,QAAA,IAAI,GAAU;IACvB,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;CACX,CAAA;AAEM,IAAM,gBAAgB,GAAG;IAC9B,YAAI,GAAG;QACL,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;KACX,CAAA;AACH,CAAC,CAAA;AALY,QAAA,gBAAgB,oBAK5B;AAEM,IAAM,cAAc,GAAG,UAAC,OAAe,EAAE,QAAgB;IAC9D,YAAI,CAAC,OAAO,IAAI,OAAO,CAAC;IACxB,YAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC;AAC5B,CAAC,CAAA;AAHY,QAAA,cAAc,kBAG1B"} -------------------------------------------------------------------------------- /lib/markdown/common/csv.d.ts: -------------------------------------------------------------------------------- 1 | export declare const CsvJoin: (csv: any, options: any, isSub?: any) => string; 2 | export declare const escapesCsvField: (cell: string, options: any) => string; 3 | -------------------------------------------------------------------------------- /lib/markdown/common/html-re.d.ts: -------------------------------------------------------------------------------- 1 | export declare const HTML_OPEN_TAG_RE: RegExp; 2 | export declare const HTML_CLOSE_TAG_RE: RegExp; 3 | export declare const HTML_OPEN_TAG: RegExp; 4 | export type type_HTML_SEQUENCES = [RegExp, RegExp | string, boolean]; 5 | export declare const HTML_SEQUENCES: type_HTML_SEQUENCES[]; 6 | export declare const selfClosingTags: string[]; 7 | export declare const extractFullHtmlTagContent: (html: string, tag: string) => string[]; 8 | -------------------------------------------------------------------------------- /lib/markdown/common/mmdRules.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum eMmdRuleType { 2 | markdown = "markdown", 3 | latex = "latex", 4 | chem = "chem", 5 | html = "html", 6 | common = "common", 7 | asciiMath = "asciiMath", 8 | math = "math", 9 | mathML = "mathML", 10 | simpleMath = "simpleMath" 11 | } 12 | export declare enum eRule { 13 | block = "block", 14 | inline = "inline", 15 | inline2 = "inline2", 16 | core = "core" 17 | } 18 | export interface IMmdRule { 19 | name: string; 20 | type: eMmdRuleType; 21 | rule: eRule; 22 | description?: string; 23 | } 24 | export declare const mmdRuleList: IMmdRule[]; 25 | -------------------------------------------------------------------------------- /lib/markdown/common/mmdRulesToDisable.d.ts: -------------------------------------------------------------------------------- 1 | import { RenderOptions } from "../../mathpix-markdown-model"; 2 | import { eMmdRuleType } from "./mmdRules"; 3 | export declare const getDisableRuleTypes: (renderOptions: RenderOptions) => eMmdRuleType[]; 4 | export declare const getListRulesToDisable: (md: any, renderOptions: RenderOptions) => string[]; 5 | export declare const applyRulesToDisableRules: (md: any, rules: string[], disableRules: string[]) => string[]; 6 | export declare const applyRefRulesToDisableRules: (md: any, disableRules: string[]) => string[]; 7 | export declare const applyFootnoteRulesToDisableRules: (md: any, disableRules: string[]) => string[]; 8 | export declare const getListToDisableByOptions: (md: MarkdownIt, options: any) => string[]; 9 | -------------------------------------------------------------------------------- /lib/markdown/common/render-table-cell-content.d.ts: -------------------------------------------------------------------------------- 1 | export declare const renderTableCellContent: (token: any, isSubTable: boolean, options: any, env: any, slf: any) => { 2 | content: string; 3 | tsv: string; 4 | csv: string; 5 | tableMd: string; 6 | tableSmoothed: string; 7 | }; 8 | -------------------------------------------------------------------------------- /lib/markdown/common/separating-span.d.ts: -------------------------------------------------------------------------------- 1 | export interface ISeparatingSpan { 2 | pos: number; 3 | content: string; 4 | nextPos: number; 5 | } 6 | export interface IContentAndSeparatingSpan { 7 | content: string; 8 | contentSpan: string; 9 | } 10 | export declare const getSeparatingSpanFromString: (str: string, pos: number, res: ISeparatingSpan[], previewUuid: string) => ISeparatingSpan[]; 11 | export declare const getContentAndSeparatingSpanFromLine: (line: string, pos?: number, previewUuid?: string, res?: IContentAndSeparatingSpan) => IContentAndSeparatingSpan; 12 | export declare const removeSeparatingSpanFromContent: (content: string, previewUuid: string) => IContentAndSeparatingSpan; 13 | export declare const getHtmlSeparatingSpanContainer: (contentSpan: string) => string; 14 | -------------------------------------------------------------------------------- /lib/markdown/common/table-markdown.d.ts: -------------------------------------------------------------------------------- 1 | export declare const getMdLink: (child: any, token: any, j: any) => string; 2 | export declare const getMdForChild: (child: any) => string; 3 | export declare const tableMarkdownJoin: (tableMd: any, align?: string) => string; 4 | -------------------------------------------------------------------------------- /lib/markdown/common/text-dimentions.d.ts: -------------------------------------------------------------------------------- 1 | import { Font } from "opentype.js"; 2 | export interface IFontMetricsOptions { 3 | font: ArrayBuffer; 4 | fontBold?: ArrayBuffer; 5 | fontSize?: number; 6 | ex?: number; 7 | fontWeight?: eFontType; 8 | } 9 | export declare enum eFontType { 10 | normal = "normal", 11 | bold = "bold" 12 | } 13 | export declare class FontMetrics { 14 | font: Font; 15 | fontBold: Font; 16 | fontSize: number; 17 | ex: number; 18 | fontWeight: eFontType; 19 | constructor(); 20 | loadFont(options: IFontMetricsOptions): void; 21 | isFontLoaded(): boolean; 22 | private getGlyph; 23 | getWidth(text: string, fontType?: eFontType): number; 24 | getWidthInEx(text: string, fontType?: eFontType): number; 25 | } 26 | export declare const fontMetrics: FontMetrics; 27 | -------------------------------------------------------------------------------- /lib/markdown/common/textWidthByTokens.d.ts: -------------------------------------------------------------------------------- 1 | import { Token } from 'markdown-it'; 2 | import { eFontType } from "./text-dimentions"; 3 | export interface ISizeEx { 4 | widthEx: number; 5 | heightEx: number; 6 | } 7 | export declare const getTextWidthByTokens: (tokens: Array, widthEx?: number, heightEx?: number, fontType?: eFontType) => ISizeEx; 8 | -------------------------------------------------------------------------------- /lib/markdown/common/tsv.d.ts: -------------------------------------------------------------------------------- 1 | export declare const TsvJoin: (tsv: any, options: any) => string; 2 | -------------------------------------------------------------------------------- /lib/markdown/common/tsv.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.TsvJoin = void 0; 4 | var tslib_1 = require("tslib"); 5 | var consts_1 = require("./consts"); 6 | var TsvJoin = function (tsv, options) { 7 | var _a = options.outMath.tsv_separators, tsv_separators = _a === void 0 ? tslib_1.__assign({}, consts_1.tsvSeparatorsDef) : _a; 8 | var column = tsv_separators.column, row = tsv_separators.row; 9 | if (!tsv || tsv.length === 0) { 10 | return ''; 11 | } 12 | return tsv.map(function (row) { return row.join(column); }).join(row); 13 | }; 14 | exports.TsvJoin = TsvJoin; 15 | //# sourceMappingURL=tsv.js.map -------------------------------------------------------------------------------- /lib/markdown/common/tsv.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"tsv.js","sourceRoot":"","sources":["../../../src/markdown/common/tsv.ts"],"names":[],"mappings":";;;;AAAA,mCAA4C;AAErC,IAAM,OAAO,GAAG,UAAC,GAAG,EAAE,OAAO;IAC3B,IAAA,KAA0C,OAAO,CAAC,OAAO,eAAnB,EAAtC,cAAc,wCAAO,yBAAgB,MAAC,CAAoB;IAC1D,IAAA,MAAM,GAAS,cAAc,OAAvB,EAAE,GAAG,GAAI,cAAc,IAAlB,CAAmB;IACrC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAG;QAC7B,OAAO,EAAE,CAAA;KACV;IACD,OAAO,GAAG,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAhB,CAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACnD,CAAC,CAAC;AAPW,QAAA,OAAO,WAOlB"} -------------------------------------------------------------------------------- /lib/markdown/dom-adaptor/index.d.ts: -------------------------------------------------------------------------------- 1 | export interface Global { 2 | document: Document; 3 | } 4 | export declare const initDocument: () => void; 5 | -------------------------------------------------------------------------------- /lib/markdown/dom-adaptor/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.initDocument = void 0; 4 | var domino = require("@mathpix/domino"); 5 | var initDocument = function () { 6 | try { 7 | document; 8 | } 9 | catch (e) { 10 | var domimpl = domino.createDOMImplementation(); 11 | global.document = domimpl.createHTMLDocument(); 12 | } 13 | }; 14 | exports.initDocument = initDocument; 15 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /lib/markdown/dom-adaptor/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/markdown/dom-adaptor/index.ts"],"names":[],"mappings":";;;AAAA,wCAA0C;AAQnC,IAAM,YAAY,GAAG;IAC1B,IAAG;QACD,QAAQ,CAAC;KACV;IAAC,OAAO,CAAC,EAAE;QACV,IAAM,OAAO,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAC;QACjD,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;KAChD;AACH,CAAC,CAAC;AAPW,QAAA,YAAY,gBAOvB"} -------------------------------------------------------------------------------- /lib/markdown/highlight/common.d.ts: -------------------------------------------------------------------------------- 1 | export declare const sortHighlights: (a: any, b: any) => 1 | -1; 2 | export declare const mergingHighlights: (highlights: any) => any; 3 | export declare const findPositionsInHighlights: (highlights: any, positions: any) => any[]; 4 | export declare const filteredHighlightContent: (highlightContent: any) => any[]; 5 | export declare const getStyleFromHighlight: (highlight: any) => string; 6 | export declare const needToHighlightAll: (token: any) => boolean; 7 | export declare const highlightText: (token: any, content?: string) => any; 8 | -------------------------------------------------------------------------------- /lib/markdown/highlight/highlight-math-token.d.ts: -------------------------------------------------------------------------------- 1 | /** Perform math to conversion to html and get additional data from MathJax to pass it to render rules */ 2 | export declare const convertMathToHtmlWithHighlight: (state: any, token: any, options: any) => any; 3 | export declare const addedHighlightMathjaxFunctions: (token: any, mathContent: any) => string; 4 | export declare const highlightMathToken: (state: any, token: any) => void; 5 | -------------------------------------------------------------------------------- /lib/markdown/highlight/render-rule-highlights.d.ts: -------------------------------------------------------------------------------- 1 | export declare const textHighlight: (tokens: any, idx: any, options: any, env: any, self: any) => any; 2 | export declare const codeInlineHighlight: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 3 | export declare const renderTextUrlHighlight: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 4 | export declare const renderMathHighlight: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 5 | export declare const captionTableHighlight: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 6 | -------------------------------------------------------------------------------- /lib/markdown/inline-styles/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare function injectInlineStyles(renderer: any): any; 2 | -------------------------------------------------------------------------------- /lib/markdown/mathpix-markdown-plugins.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mathpixMarkdownPlugin: (md: MarkdownIt, options: any) => void; 2 | export declare const setBaseOptionsMd: (baseOption: any, mmdOptions: any) => void; 3 | export declare const initMathpixMarkdown: (md: any, callback: any) => any; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-ascii/index.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const asciiMath: RuleInline; 3 | export declare const backtickAsAsciiMath: RuleInline; 4 | export declare const renderAsciiMath: (tokens: any, idx: any, options: any) => string; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-align.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const openTag: RegExp; 3 | export declare const SeparateInlineBlocksBeginAlign: (state: any, startLine: number, nextLine: number, content: string, align: string) => any[]; 4 | export declare const BeginAlign: RuleBlock; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-table.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const openTag: RegExp; 3 | export declare const openTagH: RegExp; 4 | export declare const ClearTableNumbers: () => void; 5 | export declare const ClearFigureNumbers: () => void; 6 | export declare const BeginTable: RuleBlock; 7 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/common.d.ts: -------------------------------------------------------------------------------- 1 | export type TParselines = { 2 | cLines: Array>; 3 | cSpaces: Array>; 4 | sLines: Array; 5 | }; 6 | export declare const getContent: (content: string, onlyOne?: boolean, skipTrim?: boolean) => string; 7 | export declare const generateUniqueId: (onlyUuid?: boolean) => string; 8 | export declare const getColumnLines: (str: string, numCol?: number) => Array; 9 | export declare const getColumnAlign: (align: string) => string[] | [ 10 | ]; 11 | export type TAlignData = { 12 | cAlign: Array; 13 | vAlign: Array; 14 | cWidth: Array; 15 | }; 16 | export declare const getVerticallyColumnAlign: (align: string, numCol: number) => TAlignData; 17 | export declare const getParams: (str: string, i: number) => { 18 | align: string; 19 | index: number; 20 | }; 21 | export type TDecimal = { 22 | l: number; 23 | r: number; 24 | }; 25 | export declare const getDecimal: (cAlign: Array, cellsAll: Array) => Array; 26 | export declare const getCellsAll: (rows: string[]) => string[]; 27 | export declare const getRowLines: (rows: string[], numCol: number) => TParselines; 28 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/multi-column-row.d.ts: -------------------------------------------------------------------------------- 1 | import { TMulti } from "./index"; 2 | export declare const getMC: (cell: string) => number; 3 | export declare const getCurrentMC: (cells: string[], i: number) => number; 4 | export declare const getMultiColumnMultiRow: (str: string, params: { 5 | lLines: string; 6 | align: string; 7 | rLines: string; 8 | }, forLatex?: boolean, forPptx?: boolean) => TMulti | null; 9 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/parse-tabular.d.ts: -------------------------------------------------------------------------------- 1 | import { TTokenTabular } from "./index"; 2 | export declare const separateByColumns: (str: string) => any[]; 3 | export declare const ParseTabular: (str: string, i: number, align?: string, options?: {}) => Array | null; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/sub-cell.d.ts: -------------------------------------------------------------------------------- 1 | export declare const getSubDiagbox: (str: string) => string; 2 | export declare const extractNextBraceContent: (str: string, startIndex: number) => [string, number]; 3 | export declare const findInDiagboxTable: (id: string) => string | undefined; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/sub-code.d.ts: -------------------------------------------------------------------------------- 1 | export declare const codeInlineContent: (res: any, type?: string) => any; 2 | export declare const getSubCode: (str: string) => string; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/sub-math.d.ts: -------------------------------------------------------------------------------- 1 | type TSubMath = { 2 | id: string; 3 | content: string; 4 | }; 5 | export declare const ClearSubMathLists: () => void; 6 | export declare const mathTablePush: (item: TSubMath) => void; 7 | export declare const getMathTableContent: (sub: string, i: number) => string; 8 | export declare const getSubMath: (str: string, startPos?: number) => string; 9 | export {}; 10 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/sub-tabular.d.ts: -------------------------------------------------------------------------------- 1 | import { TTokenTabular } from "./index"; 2 | export declare const ClearSubTableLists: () => void; 3 | export declare const pushSubTabular: (str: string, subTabularContent: string, subRes: Array, posBegin: number, posEnd: number, i?: number, level?: number) => string; 4 | export declare const getSubTabular: (sub: string, i: number, isCell?: boolean, forLatex?: boolean) => Array | null; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/begin-tabular/tabular-td.d.ts: -------------------------------------------------------------------------------- 1 | import { TAttrs, TTokenTabular } from './index'; 2 | import { TDecimal } from "./common"; 3 | type TLines = { 4 | left?: string; 5 | right?: string; 6 | bottom?: string; 7 | top?: string; 8 | }; 9 | type TAligns = { 10 | h?: string; 11 | v?: string; 12 | w?: string; 13 | }; 14 | export declare const setColumnLines: (aligns: TAligns | null, lines: TLines) => string[]; 15 | export declare const addStyle: (attrs: any[], style: string) => Array; 16 | export declare const addHLineIntoStyle: (attrs: any[], line?: string, pos?: string) => Array; 17 | export declare const AddTd: (content: string, aligns: TAligns | null, lines: TLines, space: string, decimal?: TDecimal | null) => { 18 | res: Array; 19 | content: string; 20 | }; 21 | export declare const AddTdSubTable: (subTable: Array, aligns: TAligns, lines: TLines) => Array; 22 | export {}; 23 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/helper.d.ts: -------------------------------------------------------------------------------- 1 | export declare const SetTokensBlockParse: (state: any, content: any, startLine?: any, endLine?: any, isInline?: boolean, contentPositions?: any, forPptx?: boolean) => void; 2 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/image-block.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const imageWithSizeBlock: RuleBlock; 3 | export declare const renderRuleImageBlock: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/lists/index.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare enum TBegin { 3 | itemize = "itemize", 4 | enumerate = "enumerate" 5 | } 6 | export declare const bItemTag: RegExp; 7 | export declare const reNumber: RegExp; 8 | export declare const ReRenderListsItem: RuleBlock; 9 | export declare const Lists: RuleBlock; 10 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/mathml-block.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from "markdown-it"; 2 | export declare const mathMLBlock: RuleBlock; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/mmd-fence.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const fenceBlock: RuleBlock; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/mmd-html-block.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from "markdown-it"; 2 | export declare const mmdHtmlBlock: RuleBlock; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/parse-error.d.ts: -------------------------------------------------------------------------------- 1 | export type TParseError = Array; 2 | export type TParseErrorList = Array; 3 | export declare var ParseErrorList: TParseErrorList; 4 | export declare var ParseError: TParseError; 5 | export declare const pushError: (messages: string) => void; 6 | export declare const pushParseErrorList: (messages: TParseError, ln: number) => void; 7 | export declare const ClearParseError: () => void; 8 | export declare const ClearParseErrorList: () => void; 9 | export declare const CheckParseError: (state: any, startLine: number, nextLine: number, content: string) => boolean; 10 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/renewcommand.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const parseOneCommand: (state: any, str: any) => number; 3 | export declare const reNewCommand: (state: any, lineText: string) => void; 4 | export declare const ReNewCommand: RuleBlock; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-block-rule/svg_block.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const svg_block: RuleBlock; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/chemistry-drawer.d.ts: -------------------------------------------------------------------------------- 1 | import { ISmilesOptions } from './index'; 2 | export declare const ChemistryDrawer: { 3 | drawSvgSync: (content: string, id: string, options?: ISmilesOptions, injectSizeAttributes?: boolean) => string; 4 | }; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/chemistry-options.d.ts: -------------------------------------------------------------------------------- 1 | export declare const setFontSize: (fontSize: number, options: any) => any; 2 | export declare const setDisableColors: (options: any, darkTextColor: any, lightTextColor: any) => any; 3 | export declare const setThemesByDefault: (options: any, darkTextColor: any, lightTextColor: any) => any; 4 | export declare const getScale: (fontSize: number) => number; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/index.d.ts: -------------------------------------------------------------------------------- 1 | import { ISmilesOptionsDef } from "./smiles-drawer/src/Drawer"; 2 | export interface ISmilesOptions extends ISmilesOptionsDef { 3 | theme?: string; 4 | stretch?: boolean; 5 | scale?: number; 6 | fontSize?: number; 7 | disableColors?: boolean; 8 | disableGradient?: boolean; 9 | autoScale?: boolean; 10 | isTesting?: boolean; 11 | useCurrentColor?: boolean; 12 | supportSvg1?: boolean; 13 | } 14 | declare const _default: (md: MarkdownIt, options: any) => void; 15 | export default _default; 16 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/smiles-drawer/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The SmilesDrawer namespace. 3 | * @typicalname SmilesDrawer 4 | */ 5 | declare var SmilesDrawer: any; 6 | export default SmilesDrawer; 7 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/smiles-drawer/src/Parser.d.ts: -------------------------------------------------------------------------------- 1 | declare class pegSyntaxError extends Error { 2 | expected: any; 3 | found: any; 4 | location: any; 5 | name: string; 6 | constructor(message: any, expected: any, found?: any, location?: any); 7 | } 8 | declare function peg$parse(input: any, options: any): any; 9 | declare const Parser: { 10 | SyntaxError: typeof pegSyntaxError; 11 | parse: typeof peg$parse; 12 | }; 13 | export default Parser; 14 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/smiles-drawer/src/ThemeManager.d.ts: -------------------------------------------------------------------------------- 1 | declare class ThemeManager { 2 | colors: any; 3 | theme: any; 4 | constructor(colors: any, theme: any); 5 | /** 6 | * Returns the hex code of a color associated with a key from the current theme. 7 | * 8 | * @param {String} key The color key in the theme (e.g. C, N, BACKGROUND, ...). 9 | * @returns {String} A color hex value. 10 | */ 11 | getColor(key: any): any; 12 | /** 13 | * Sets the theme to the specified string if it exists. If it does not, this 14 | * does nothing. 15 | * 16 | * @param {String} theme the name of the theme to switch to 17 | */ 18 | setTheme(theme: any): void; 19 | } 20 | export default ThemeManager; 21 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/smiles-drawer/src/ThemeManager.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ThemeManager.js","sourceRoot":"","sources":["../../../../../src/markdown/md-chemistry/smiles-drawer/src/ThemeManager.ts"],"names":[],"mappings":";;AAAA;IAIE,sBAAY,MAAM,EAAE,KAAK;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACH,+BAAQ,GAAR,UAAS,GAAG;QACV,IAAI,GAAG,EAAE;YACP,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YAExB,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE;gBACrB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACxB;SACF;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACH,+BAAQ,GAAR,UAAS,KAAK;QACZ,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;YACrC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACjC;QAED,sEAAsE;QACtE,mEAAmE;QACnE,aAAa;IACf,CAAC;IACH,mBAAC;AAAD,CAAC,AA1CD,IA0CC;AAED,kBAAe,YAAY,CAAC"} -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/smiles-drawer/src/UtilityFunctions.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Translate the integer indicating the charge to the appropriate text. 3 | * @param {Number} charge The integer indicating the charge. 4 | * @returns {String} A string representing a charge. 5 | */ 6 | export declare function getChargeText(charge: any): "" | "-" | "+" | "2+" | "2-"; 7 | -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/smiles-drawer/src/UtilityFunctions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.getChargeText = void 0; 4 | /** 5 | * Translate the integer indicating the charge to the appropriate text. 6 | * @param {Number} charge The integer indicating the charge. 7 | * @returns {String} A string representing a charge. 8 | */ 9 | function getChargeText(charge) { 10 | // console.log('in the utility version of getChargeText'); 11 | if (charge === 1) { 12 | return '+'; 13 | } 14 | else if (charge === 2) { 15 | return '2+'; 16 | } 17 | else if (charge === -1) { 18 | return '-'; 19 | } 20 | else if (charge === -2) { 21 | return '2-'; 22 | } 23 | else { 24 | return ''; 25 | } 26 | } 27 | exports.getChargeText = getChargeText; 28 | //# sourceMappingURL=UtilityFunctions.js.map -------------------------------------------------------------------------------- /lib/markdown/md-chemistry/smiles-drawer/src/UtilityFunctions.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"UtilityFunctions.js","sourceRoot":"","sources":["../../../../../src/markdown/md-chemistry/smiles-drawer/src/UtilityFunctions.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,aAAa,CAAC,MAAM;IAClC,0DAA0D;IAC1D,IAAI,MAAM,KAAK,CAAC,EAAE;QAChB,OAAO,GAAG,CAAA;KACX;SAAM,IAAI,MAAM,KAAK,CAAC,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE;QACxB,OAAO,GAAG,CAAC;KACZ;SAAM,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE;QACxB,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAbD,sCAaC"} -------------------------------------------------------------------------------- /lib/markdown/md-core-rules/set-positions.d.ts: -------------------------------------------------------------------------------- 1 | export declare const setPositions: (state: any) => void; 2 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/core-inline.d.ts: -------------------------------------------------------------------------------- 1 | /** Top-level inline rule executor 2 | * Replace inline core rule 3 | * 4 | * By default the state.env that is passed to the inline parser only has the latest values. 5 | * We add this rule to be able to pass the current variables (obtained during block parsing) to the inline parser. 6 | * This is necessary to match labels with the current block. 7 | * */ 8 | export declare const coreInline: (state: any) => void; 9 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/diagbox-inline.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from "markdown-it"; 2 | export declare const inlineDiagbox: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/html_inline_full_tag.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const html_inline_full_tag: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/image.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export interface IParseImageParams { 3 | attr: Array>; 4 | align: string; 5 | latex: string; 6 | } 7 | export declare const parseImageParams: (str: string, align?: string) => IParseImageParams | null; 8 | /** Process ![image]( "title") 9 | * Replace image inline rule: 10 | * Process: 11 | * ![image]( "title") 12 | * ![image]( "title"){width=50%} 13 | * ![image]( "title"){width="10px"} 14 | * ![image]( "title"){width="20px",height="20px"} 15 | * ![image]( "title"){width="20px",height="20px",right} 16 | * */ 17 | export declare const imageWithSize: RuleInline; 18 | export declare const renderRuleImage: (tokens: any, idx: any, options: any, env: any, slf: any) => any; 19 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/includegraphics.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ParseIncludeGraphics: (str: string, i: number, align?: string) => any[]; 2 | export declare const StatePushIncludeGraphics: (state: any, startLine: number, nextLine: number, content: string, align: string) => boolean; 3 | export declare const InlineIncludeGraphics: (state: any, silent: any) => boolean; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/lists.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const listCloseInline: RuleInline; 3 | export declare const listBeginInline: RuleInline; 4 | export declare const listItemInline: RuleInline; 5 | export declare const listSetCounterInline: RuleInline; 6 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/mathml-inline.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from "markdown-it"; 2 | export declare const inlineMathML: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/mmd-icon.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from "markdown-it"; 2 | export declare const inlineMmdIcon: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/new-line-to-space.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const newlineToSpace: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/refs.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const refsInline: RuleInline; 3 | export declare const refInsideMathDelimiter: RuleInline; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/renewcommand.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const reNewCommandInLine: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/renewcommand.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.reNewCommandInLine = void 0; 4 | var renewcommand_1 = require("../md-block-rule/renewcommand"); 5 | var reNewCommandInLine = function (state, silent) { 6 | var match; 7 | var startMathPos = state.pos; 8 | var reItem = /^(?:renewcommand)/; 9 | if (state.src.charCodeAt(startMathPos) !== 0x5c /* \ */) { 10 | return false; 11 | } 12 | if (silent) { 13 | return false; 14 | } 15 | startMathPos += 1; 16 | match = state.src 17 | .slice(startMathPos) 18 | .match(reItem); 19 | if (!match) { 20 | return false; 21 | } 22 | var endPos = (0, renewcommand_1.parseOneCommand)(state, state.src.slice(startMathPos + match[0].length)); 23 | if (state.md.options && state.md.options.forLatex) { 24 | var token = state.push("renewcommand", "", 0); 25 | token.latex = state.src.slice(startMathPos + match[0].length) 26 | .trim(); 27 | } 28 | state.pos = startMathPos + match[0].length + endPos + 1; 29 | return true; 30 | }; 31 | exports.reNewCommandInLine = reNewCommandInLine; 32 | //# sourceMappingURL=renewcommand.js.map -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/renewcommand.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"renewcommand.js","sourceRoot":"","sources":["../../../src/markdown/md-inline-rule/renewcommand.ts"],"names":[],"mappings":";;;AACA,8DAA8D;AAGvD,IAAM,kBAAkB,GAAe,UAAC,KAAK,EAAE,MAAM;IAC1D,IAAI,KAAsB,CAAC;IAC3B,IAAI,YAAY,GAAW,KAAK,CAAC,GAAG,CAAC;IAErC,IAAM,MAAM,GAAW,mBAAmB,CAAC;IAE3C,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,OAAO,EAAG;QACxD,OAAO,KAAK,CAAC;KACd;IACD,IAAI,MAAM,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,YAAY,IAAI,CAAC,CAAC;IAElB,KAAK,GAAG,KAAK,CAAC,GAAG;SACd,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,CAAC,MAAM,CAAC,CAAC;IACjB,IAAI,CAAC,KAAK,EAAC;QAAE,OAAO,KAAK,CAAA;KAAC;IAE1B,IAAM,MAAM,GAAG,IAAA,8BAAe,EAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACvF,IAAI,KAAK,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE;QACjD,IAAI,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9C,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;aAC1D,IAAI,EAAE,CAAC;KACX;IACD,KAAK,CAAC,GAAG,GAAG,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA5BW,QAAA,kBAAkB,sBA4B7B"} -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/setcounter-section.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | /** `\setcounter{section}{number}` 3 | * Sets count for `section` to contain the value number. 4 | * *Note:* number can be positive or negative. 5 | * */ 6 | export declare const setCounterSection: RuleInline; 7 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/tabular.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const inlineTabular: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/text-collapse.d.ts: -------------------------------------------------------------------------------- 1 | export declare const textCollapse: (state: any) => void; 2 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/text-mode.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const textMode: RuleInline; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/underline.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const textUnderline: RuleInline; 3 | export declare const textOut: RuleInline; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/utils.d.ts: -------------------------------------------------------------------------------- 1 | export declare const endTag: (arg: string) => RegExp; 2 | export declare const includegraphicsTag: RegExp; 3 | export declare const includegraphicsTagB: RegExp; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.includegraphicsTagB = exports.includegraphicsTag = exports.endTag = void 0; 4 | var endTag = function (arg) { 5 | return new RegExp('\\\\end\s{0,}\{(' + arg + ')\}'); 6 | }; 7 | exports.endTag = endTag; 8 | exports.includegraphicsTag = /\\includegraphics\s{0,}\[?([^}]*)\]?\s{0,}\{([^}]*)\}/; 9 | exports.includegraphicsTagB = /^\\includegraphics\s{0,}\[?([^}]*)\]?\s{0,}\{([^}]*)\}/; 10 | //# sourceMappingURL=utils.js.map -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule/utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/markdown/md-inline-rule/utils.ts"],"names":[],"mappings":";;;AAAO,IAAM,MAAM,GAAG,UAAC,GAAW;IAChC,OAAO,IAAI,MAAM,CAAC,kBAAkB,GAAG,GAAG,GAAG,KAAK,CAAC,CAAA;AACrD,CAAC,CAAC;AAFW,QAAA,MAAM,UAEjB;AAEW,QAAA,kBAAkB,GAAW,uDAAuD,CAAC;AACrF,QAAA,mBAAmB,GAAW,wDAAwD,CAAC"} -------------------------------------------------------------------------------- /lib/markdown/md-inline-rule2/mmd-html_inline2.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mmdHtmlInline2: (state: any) => void; 2 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/block-rule.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const latex_footnote_block: RuleBlock; 3 | export declare const latex_footnotetext_block: RuleBlock; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/core-rule.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mmd_footnote_tail: (state: any) => void; 2 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/index.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: (md: MarkdownIt, options: any) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/inline-rule.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | export declare const latex_footnote: RuleInline; 3 | export declare const latex_footnotemark: RuleInline; 4 | export declare const latex_footnotetext: RuleInline; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/inline-ruler2.d.ts: -------------------------------------------------------------------------------- 1 | export declare const grab_footnote_ref: (state: any) => void; 2 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/interfaces.d.ts: -------------------------------------------------------------------------------- 1 | import { Token } from "markdown-it"; 2 | export interface FootnoteItem { 3 | id?: number; 4 | footnoteId?: number; 5 | count?: number; 6 | content?: string; 7 | tokens?: Array; 8 | numbered?: number; 9 | type?: string; 10 | lastNumber?: number; 11 | isBlock?: boolean; 12 | counter_footnote?: number; 13 | hasContent?: boolean; 14 | markerId?: number; 15 | textId?: number; 16 | } 17 | export interface FootnoteMeta { 18 | id: number; 19 | footnoteId?: number; 20 | numbered?: number; 21 | lastNumber?: number; 22 | type?: string; 23 | isBlock?: boolean; 24 | hasContent?: boolean; 25 | } 26 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/interfaces.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=interfaces.js.map -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/interfaces.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/markdown/md-latex-footnotes/interfaces.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/render-rule.d.ts: -------------------------------------------------------------------------------- 1 | export declare const render_footnote_anchor_name: (tokens: any, idx: any, options: any, env: any) => string; 2 | export declare const render_footnote_caption: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 3 | export declare const render_footnote_ref: (tokens: any, idx: any, options: any, env: any, slf: any) => any; 4 | export declare const render_footnote_block_open: (tokens: any, idx: any, options: any) => string; 5 | export declare const render_footnote_block_close: () => string; 6 | export declare const render_footnote_list_open: (tokens: any, idx: any, options: any) => "
    \n" | "
      \n"; 7 | export declare const render_footnote_list_close: () => string; 8 | export declare const render_footnote_open: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 9 | export declare const render_footnote_close: () => string; 10 | export declare const render_footnote_anchor: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 11 | export declare const render_footnotetext: () => string; 12 | -------------------------------------------------------------------------------- /lib/markdown/md-latex-footnotes/utils.d.ts: -------------------------------------------------------------------------------- 1 | import { FootnoteItem, FootnoteMeta } from "./interfaces"; 2 | export declare const addFootnoteToListForFootnote: (state: any, token: any, tokens: any, envText: any, numbered: any, isBlock?: boolean) => void; 3 | export declare const addFootnoteToListForFootnotetext: (state: any, token: any, tokens: any, envText: any, numbered: any, isBlock?: boolean) => void; 4 | export declare const addFootnoteToListForBlFootnotetext: (state: any, token: any, tokens: any, envText: any, isBlock?: boolean) => void; 5 | export declare const getFootnoteItem: (env: any, meta: FootnoteMeta) => FootnoteItem; 6 | export declare const set_mmd_footnotes_list: (list: any) => void; 7 | export declare const rest_mmd_footnotes_list: () => void; 8 | -------------------------------------------------------------------------------- /lib/markdown/md-renderer-rules/breaks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Replacing the default rules to ignore insertion of line breaks after hidden tokens. 3 | * Hidden tokens do not participate in rendering 4 | * */ 5 | export declare const softBreak: (tokens: any, idx: any, options: any) => "" | "\n" | " " | "
      \n" | "
      \n" | "
      \n" | "
      \n"; 6 | export declare const hardBreak: (tokens: any, idx: any, options: any) => "" | "
      \n" | "
      \n" | "
      \n" | "
      \n"; 7 | -------------------------------------------------------------------------------- /lib/markdown/md-renderer-rules/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Renderer } from 'markdown-it'; 2 | export declare const CaptionTable: Renderer; 3 | export declare const InlineDecimal: (a: any, token: any) => string; 4 | export declare const IncludeGraphics: (a: any, token: any, slf: any, width: any, options: any) => string; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-renderer-rules/render-diagbox.d.ts: -------------------------------------------------------------------------------- 1 | import { Token } from "markdown-it"; 2 | export declare const renderDiagBoxItem: (tokens: Token[], idx: number, options: Record, env: Record, slf: Renderer) => string; 3 | export declare const renderDiagbox: (tokens: Token[], idx: number, options: unknown, env: Record, slf: Renderer) => string; 4 | -------------------------------------------------------------------------------- /lib/markdown/md-renderer-rules/render-lists.d.ts: -------------------------------------------------------------------------------- 1 | export declare const render_itemize_list_open: (tokens: any, index: any, options: any, env: any, renderer: any) => string; 2 | export declare const render_enumerate_list_open: (tokens: any, index: any, options: any, env: any, renderer: any) => string; 3 | export declare const render_item_inline: (tokens: any, index: any, options: any, env: any, slf: any) => string; 4 | export declare const render_latex_list_item_open: (tokens: any, index: any, options: any, env: any, slf: any) => string; 5 | export declare const render_latex_list_item_close: () => string; 6 | export declare const render_itemize_list_close: () => "" | ""; 7 | export declare const render_enumerate_list_close: () => string; 8 | -------------------------------------------------------------------------------- /lib/markdown/md-renderer-rules/render-tabular.d.ts: -------------------------------------------------------------------------------- 1 | export declare const renderInlineTokenBlock: (tokens: any, options: any, env: any, slf: any, isSubTable?: boolean, highlight?: any) => { 2 | table: string; 3 | tsv: string; 4 | tableMd: string; 5 | align: string; 6 | csv?: undefined; 7 | tableSmoothed?: undefined; 8 | } | { 9 | table: string; 10 | tsv: any[]; 11 | csv: any[]; 12 | tableMd: any[]; 13 | tableSmoothed: any[]; 14 | align: string; 15 | }; 16 | export declare const renderTabularInline: (a: any, token: any, options: any, env: any, slf: any) => string; 17 | -------------------------------------------------------------------------------- /lib/markdown/md-renderer-rules/underline.d.ts: -------------------------------------------------------------------------------- 1 | export declare const renderUnderlineText: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 2 | export declare const renderUnderlineOpen: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 3 | export declare const renderUnderlineClose: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 4 | export declare const renderOutOpen: (tokens: any, idx: any, options: any, env: any, slf: any) => string; 5 | export declare const renderOutText: (tokens: any, idx: any, options: any, env: any, slf: any) => any; 6 | -------------------------------------------------------------------------------- /lib/markdown/md-svg-to-base64/base64.d.ts: -------------------------------------------------------------------------------- 1 | declare const Base64: { 2 | characters: string; 3 | encode: (input: any) => string; 4 | utf8Encode: (string: any) => string; 5 | }; 6 | export default Base64; 7 | -------------------------------------------------------------------------------- /lib/markdown/md-svg-to-base64/convert-scv-to-base64.d.ts: -------------------------------------------------------------------------------- 1 | declare const convertSvgToBase64: (svgString?: string, id?: string) => string; 2 | export default convertSvgToBase64; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-svg-to-base64/convert-scv-to-base64.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var base64_1 = require("./base64"); 4 | var convertSvgToBase64 = function (svgString, id) { 5 | if (svgString === void 0) { svgString = ''; } 6 | if (id === void 0) { id = ''; } 7 | var PREFIX = 'data:image/svg+xml;base64,'; 8 | var base64Encode = PREFIX + base64_1.default.encode(svgString); 9 | return id 10 | ? '' 11 | : ''; 12 | }; 13 | exports.default = convertSvgToBase64; 14 | //# sourceMappingURL=convert-scv-to-base64.js.map -------------------------------------------------------------------------------- /lib/markdown/md-svg-to-base64/convert-scv-to-base64.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"convert-scv-to-base64.js","sourceRoot":"","sources":["../../../src/markdown/md-svg-to-base64/convert-scv-to-base64.ts"],"names":[],"mappings":";;AAAA,mCAA8B;AAE9B,IAAM,kBAAkB,GAAG,UAAC,SAAsB,EAAE,EAAe;IAAvC,0BAAA,EAAA,cAAsB;IAAE,mBAAA,EAAA,OAAe;IACjE,IAAM,MAAM,GAAG,4BAA4B,CAAC;IAC5C,IAAM,YAAY,GAAG,MAAM,GAAG,gBAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvD,OAAO,EAAE;QACP,CAAC,CAAC,6BAA6B,GAAG,EAAE,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM;QAC1E,CAAC,CAAC,4BAA4B,GAAG,YAAY,GAAG,MAAM,CAAC;AAC3D,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"} -------------------------------------------------------------------------------- /lib/markdown/md-svg-to-base64/index.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: (md: MarkdownIt, options: any) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /lib/markdown/md-theorem/block-rule.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock } from 'markdown-it'; 2 | export declare const newTheoremBlock: RuleBlock; 3 | export declare const BeginTheorem: RuleBlock; 4 | export declare const BeginProof: RuleBlock; 5 | -------------------------------------------------------------------------------- /lib/markdown/md-theorem/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare const mappingTheorems: { 2 | newtheorem: string; 3 | theoremstyle: string; 4 | theorem_open: string; 5 | theorem_close: string; 6 | proof_open: string; 7 | proof_close: string; 8 | proof_print: string; 9 | qedsymbol: string; 10 | qedsymbol_open: string; 11 | qedsymbol_close: string; 12 | renewcommand_qedsymbol: string; 13 | theorem_description_open: string; 14 | theorem_description_close: string; 15 | theorem_print_open: string; 16 | theorem_print_close: string; 17 | theorem_setcounter: string; 18 | }; 19 | export declare const renderTheorems: (md: MarkdownIt) => void; 20 | -------------------------------------------------------------------------------- /lib/markdown/mdHighlightCodePlugin.d.ts: -------------------------------------------------------------------------------- 1 | declare const highlightjs: (md: any, opts: any) => void; 2 | export default highlightjs; 3 | -------------------------------------------------------------------------------- /lib/markdown/mdOptions.d.ts: -------------------------------------------------------------------------------- 1 | export declare const validateLinkEnableFile: (url: any) => boolean; 2 | -------------------------------------------------------------------------------- /lib/markdown/mdOptions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.validateLinkEnableFile = void 0; 4 | var BAD_PROTO_RE = /^(vbscript|javascript|data):/; 5 | var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/; 6 | var validateLinkEnableFile = function (url) { 7 | // url should be normalized at this point, and existing entities are decoded 8 | var str = url.trim().toLowerCase(); 9 | return BAD_PROTO_RE.test(str) 10 | ? GOOD_DATA_RE.test(str) 11 | ? true 12 | : false 13 | : true; 14 | }; 15 | exports.validateLinkEnableFile = validateLinkEnableFile; 16 | //# sourceMappingURL=mdOptions.js.map -------------------------------------------------------------------------------- /lib/markdown/mdOptions.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mdOptions.js","sourceRoot":"","sources":["../../src/markdown/mdOptions.ts"],"names":[],"mappings":";;;AAAA,IAAM,YAAY,GAAG,8BAA8B,CAAC;AACpD,IAAM,YAAY,GAAG,mCAAmC,CAAC;AAElD,IAAM,sBAAsB,GAAG,UAAC,GAAG;IACxC,4EAA4E;IAC5E,IAAM,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3B,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;YACtB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,KAAK;QACT,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC"} -------------------------------------------------------------------------------- /lib/markdown/mdPluginAnchor.d.ts: -------------------------------------------------------------------------------- 1 | declare const anchor: { 2 | (md: MarkdownIt, opts: any): void; 3 | defaults: { 4 | level: number; 5 | }; 6 | }; 7 | export default anchor; 8 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginCollapsible.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: (md: any) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginConfigured.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * configured custom mathjax plugin 3 | */ 4 | export declare const mdPluginMathJax: (options: any) => (md: any) => void; 5 | /** 6 | * configured custom tag plugin 7 | */ 8 | export declare const mdPluginText: () => (md: MarkdownIt) => void; 9 | export declare const mdPluginHighlightCode: (md: any, opts: any) => void; 10 | export declare const mdPluginTOC: (md: MarkdownIt, opts: any) => void; 11 | export declare const mdPluginAnchor: { 12 | (md: MarkdownIt, opts: any): void; 13 | defaults: { 14 | level: number; 15 | }; 16 | }; 17 | export declare const mdPluginTableTabular: (md: MarkdownIt, options: any) => void; 18 | export declare const mdPluginList: (md: MarkdownIt, options: any) => void; 19 | export declare const mdPluginChemistry: (md: MarkdownIt, options: any) => void; 20 | export declare const mdPluginSvgToBase64: (md: MarkdownIt, options: any) => void; 21 | export declare const mdPluginCollapsible: (md: any) => void; 22 | export declare const mdSetPositionsAndHighlight: (md: MarkdownIt, options: any) => void; 23 | export declare const mdLatexFootnotes: (md: MarkdownIt, options: any) => void; 24 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginConfigured.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mdPluginConfigured.js","sourceRoot":"","sources":["../../src/markdown/mdPluginConfigured.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,+CAAwC;AACxC,iEAAsD;AACtD,6CAAsC;AACtC,mDAA4C;AAC5C,+DAAwD;AACxD,iDAA0C;AAC1C,6DAAsD;AACtD,+CAA6C;AAC7C,uDAAmD;AACnD,2EAA0E;AAC1E,2DAA6D;AAE7D;;GAEG;AACU,QAAA,eAAe,GAAG,qBAAa,CAAC;AAE7C;;GAEG;AACU,QAAA,YAAY,GAAG,sBAAU,CAAC;AAC1B,QAAA,qBAAqB,GAAG,+BAAe,CAAC;AACxC,QAAA,WAAW,GAAG,qBAAS,CAAC;AACxB,QAAA,cAAc,GAAG,wBAAY,CAAC;AAC9B,QAAA,oBAAoB,GAAG,8BAAkB,CAAC;AAC1C,QAAA,YAAY,GAAG,uBAAW,CAAC;AAC3B,QAAA,iBAAiB,GAAG,sBAAe,CAAC;AACpC,QAAA,mBAAmB,GAAG,0BAAiB,CAAC;AAExC,QAAA,mBAAmB,GAAG,6BAAiB,CAAC;AACxC,QAAA,0BAA0B,GAAG,oCAA8B,CAAC;AAC5D,QAAA,gBAAgB,GAAG,4BAAyB,CAAC"} -------------------------------------------------------------------------------- /lib/markdown/mdPluginLists.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: (md: MarkdownIt, options: any) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginRaw.d.ts: -------------------------------------------------------------------------------- 1 | export declare const findEndMarkerPos: (str: string, endMarker: string, i: number) => number; 2 | declare const _default: (options: any) => (md: any) => void; 3 | export default _default; 4 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginSeparateForBlock.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: (md: MarkdownIt) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginTOC.d.ts: -------------------------------------------------------------------------------- 1 | import { Token } from 'markdown-it'; 2 | export interface ITocItem { 3 | level: number; 4 | link: string; 5 | value: string; 6 | content: string; 7 | children?: Array; 8 | subHeadings?: Array; 9 | } 10 | export interface ITocData { 11 | index: number; /** Index of the token in the array of tokens for building nested headers */ 12 | tocList: Array; 13 | } 14 | export declare const clearSlugsTocItems: () => void; 15 | declare const _default: (md: MarkdownIt, opts: any) => void; 16 | export default _default; 17 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginTableTabular.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: (md: MarkdownIt, options: any) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /lib/markdown/mdPluginText.d.ts: -------------------------------------------------------------------------------- 1 | import { RuleBlock, RuleInline } from 'markdown-it'; 2 | export declare let sectionCount: number; 3 | export declare let subCount: number; 4 | export declare let subSubCount: number; 5 | export declare const resetCounter: RuleInline; 6 | export declare const resetTextCounter: RuleInline; 7 | export declare const setTextCounterSection: (envName: string, num: number) => void; 8 | export declare const headingSection: RuleBlock; 9 | export declare const renderInlineContent: (token: any, options: any, env: any, slf: any) => any; 10 | declare const _default: () => (md: MarkdownIt) => void; 11 | export default _default; 12 | -------------------------------------------------------------------------------- /lib/markdown/mdSetPositionsAndHighlight.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: (md: MarkdownIt, options: any) => void; 2 | export default _default; 3 | -------------------------------------------------------------------------------- /lib/markdown/mdSetPositionsAndHighlight.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mdSetPositionsAndHighlight.js","sourceRoot":"","sources":["../../src/markdown/mdSetPositionsAndHighlight.ts"],"names":[],"mappings":";;AACA,+DAA6D;AAC7D,6EAM4C;AAE5C,mBAAe,UAAC,EAAc,EAAE,OAAO;;IACrC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnC,8BAA8B;IAC9B,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,4BAAY,CAAC,CAAC;IAElD,IAAI,MAAA,EAAE,CAAC,OAAO,CAAC,UAAU,0CAAE,MAAM,EAAE;QACjC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,sCAAa,CAAC;QACvC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,GAAG,4CAAmB,CAAC;QACpD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,GAAG,+CAAsB,CAAC;QACnD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW;cACzB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY;kBAC9B,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa;sBAC/B,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB;0BAC1C,4CAAmB,CAAC;QACxB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,GAAG,8CAAqB,CAAC;KACzD;AACH,CAAC,EAAA"} -------------------------------------------------------------------------------- /lib/markdown/rules.d.ts: -------------------------------------------------------------------------------- 1 | export declare const PREVIEW_PARAGRAPH_PREFIX = "preview-paragraph-"; 2 | export declare const PREVIEW_LINE_CLASS = "preview-line"; 3 | export declare function code_block_injectLineNumbers(tokens: any, idx: any, options: any, env: any, slf: any): string; 4 | /** overwrite paragraph_open and close rule to inject line number */ 5 | export declare function withLineNumbers(renderer: any): any; 6 | export declare function injectLabelIdToParagraph(renderer: any): any; 7 | export declare const injectRenderRules: (renderer: any) => any; 8 | -------------------------------------------------------------------------------- /lib/markdown/sanitize/attrs.d.ts: -------------------------------------------------------------------------------- 1 | export declare const svgAttrs: string[]; 2 | export declare const htmlAttrs: string[]; 3 | -------------------------------------------------------------------------------- /lib/markdown/sanitize/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare const sanitize: (html: string, options?: {}) => any; 2 | -------------------------------------------------------------------------------- /lib/markdown/sanitize/tags.d.ts: -------------------------------------------------------------------------------- 1 | export declare const svgTags: string[]; 2 | export declare const htmlTags: string[]; 3 | -------------------------------------------------------------------------------- /lib/mathjax/fix-unicode.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Default handling of characters (as elements). 3 | * @param {TexParser} parser The calling parser. 4 | * @param {string} char The character to parse. 5 | */ 6 | export declare function Other(parser: any, char: any): void; 7 | -------------------------------------------------------------------------------- /lib/mathjax/fix-unicode.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"fix-unicode.js","sourceRoot":"","sources":["../../src/mathjax/fix-unicode.ts"],"names":[],"mappings":";;;AAAA,mEAAkE;AAClE,+DAA0D;AAC1D,sFAA2E;AAC3E,uEAAsE;AAEtE;;GAEG;AACH,IAAI,2BAAY,CAAC,OAAO,EAAE,IAAI,EAAE;IAC9B,GAAG,EAAI,QAAQ;IACf,GAAG,EAAI,QAAQ;IACf,GAAG,EAAI,QAAQ,CAAG,sBAAsB;CACzC,CAAC,CAAC;AAEH;;;;GAIG;AACH,SAAgB,KAAK,CAAC,MAAM,EAAE,IAAI;IAChC,IAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,GAAG,GAAG,IAAI;QACZ,CAAC,CAAC,EAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAC;QACzC,CAAC,CAAC,EAAE,CAAC;IACP,IAAM,KAAK,GAAI,uBAAU,CAAC,MAAM,CAAC,OAAO,CAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxE,IAAM,KAAK,GAAG,IAAA,6BAAQ,EAAC,IAAI,CAAC,CAAC;IAC7B,IAAM,IAAI,GAAG,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,KAAI,IAAI,CAAC;IAChC,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,KAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,IAAI,IAAI,KAAK,IAAI,EAAE;QACjB,kBAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QAC9C,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;KACjD;IACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAfD,sBAeC"} -------------------------------------------------------------------------------- /lib/mathjax/helpers/array/ArrayConfiguration.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration file for the Array package. 3 | */ 4 | import { Configuration } from 'mathjax-full/js/input/tex/Configuration.js'; 5 | import './ArrayMappings'; 6 | export declare const ArrayConfiguration: Configuration; 7 | -------------------------------------------------------------------------------- /lib/mathjax/helpers/array/ArrayConfiguration.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Configuration file for the Array package. 4 | */ 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | exports.ArrayConfiguration = void 0; 7 | var Configuration_js_1 = require("mathjax-full/js/input/tex/Configuration.js"); 8 | require("./ArrayMappings"); 9 | exports.ArrayConfiguration = Configuration_js_1.Configuration.create('array', { 10 | handler: { 11 | environment: ['array-environment'] 12 | } 13 | }); 14 | //# sourceMappingURL=ArrayConfiguration.js.map -------------------------------------------------------------------------------- /lib/mathjax/helpers/array/ArrayConfiguration.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ArrayConfiguration.js","sourceRoot":"","sources":["../../../../src/mathjax/helpers/array/ArrayConfiguration.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,+EAA2E;AAC3E,2BAAyB;AAEZ,QAAA,kBAAkB,GAAG,gCAAa,CAAC,MAAM,CACpD,OAAO,EACP;IACE,OAAO,EAAE;QACP,WAAW,EAAE,CAAC,mBAAmB,CAAC;KACnC;CACF,CACF,CAAC"} -------------------------------------------------------------------------------- /lib/mathjax/helpers/array/ArrayMappings.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /lib/mathjax/helpers/array/ArrayMappings.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var sm = require("mathjax-full/js/input/tex/SymbolMap.js"); 4 | var ParseMethods_js_2 = require("mathjax-full/js/input/tex/ParseMethods.js"); 5 | var ParseUtil_js_1 = require("mathjax-full/js/input/tex/ParseUtil.js"); 6 | var ArrayMethods_1 = require("./ArrayMethods"); 7 | /** 8 | * Copied from /mathjax-full/ts/input/tex/ams/AmsMappings.ts 9 | */ 10 | var COLS = function (W) { 11 | var WW = []; 12 | for (var i = 0, m = W.length; i < m; i++) { 13 | WW[i] = ParseUtil_js_1.default.Em(W[i]); 14 | } 15 | return WW.join(' '); 16 | }; 17 | /** 18 | * Environments from the Array package. 19 | */ 20 | new sm.EnvironmentMap('array-environment', ParseMethods_js_2.default.environment, { 21 | array: ['AlignedArray'], 22 | gathered: ['AmsEqnArray', null, null, null, 'c', null, '.5em', 'D'], 23 | aligned: ['AmsEqnArray', null, null, null, 'rlrlrlrlrlrl', 24 | COLS([0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0]), '.5em', 'D'], 25 | }, ArrayMethods_1.default); 26 | //# sourceMappingURL=ArrayMappings.js.map -------------------------------------------------------------------------------- /lib/mathjax/helpers/array/ArrayMappings.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ArrayMappings.js","sourceRoot":"","sources":["../../../../src/mathjax/helpers/array/ArrayMappings.ts"],"names":[],"mappings":";;AAAA,2DAA8D;AAC9D,6EAAqE;AACrE,uEAA+D;AAC/D,+CAA0C;AAE1C;;GAEG;AACH,IAAI,IAAI,GAAG,UAAS,CAAW;IAC7B,IAAM,EAAE,GAAa,EAAE,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACxC,EAAE,CAAC,CAAC,CAAC,GAAG,sBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5B;IACD,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF;;GAEG;AACH,IAAI,EAAE,CAAC,cAAc,CAAC,mBAAmB,EAAE,yBAAY,CAAC,WAAW,EAAE;IACnE,KAAK,EAAU,CAAC,cAAc,CAAC;IAC/B,QAAQ,EAAO,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC;IACxE,OAAO,EAAQ,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc;QAC7D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC;CACxD,EAAE,sBAAY,CAAC,CAAC"} -------------------------------------------------------------------------------- /lib/mathjax/helpers/array/ArrayMethods.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview The Array Parse methods. 3 | */ 4 | import { ParseMethod } from 'mathjax-full/js/input/tex/Types.js'; 5 | declare let ArrayMethods: Record; 6 | export default ArrayMethods; 7 | -------------------------------------------------------------------------------- /lib/mathjax/helpers/icon/IconConfiguration.d.ts: -------------------------------------------------------------------------------- 1 | import { Configuration } from 'mathjax-full/js/input/tex/Configuration.js'; 2 | import { ParseMethod } from 'mathjax-full/js/input/tex/Types.js'; 3 | export declare let IconMethods: Record; 4 | export declare const IconConfiguration: Configuration; 5 | -------------------------------------------------------------------------------- /lib/mathjax/helpers/icon/IconConstants.d.ts: -------------------------------------------------------------------------------- 1 | export declare const COLORS: Map; 2 | -------------------------------------------------------------------------------- /lib/mathjax/helpers/icon/IconMethods.d.ts: -------------------------------------------------------------------------------- 1 | import { ParseMethod } from 'mathjax-full/js/input/tex/Types.js'; 2 | export declare const IconMethods: Record; 3 | -------------------------------------------------------------------------------- /lib/mathjax/mathJaxConfig.d.ts: -------------------------------------------------------------------------------- 1 | declare const MathJaxConfig: { 2 | TeX: { 3 | packages: string[]; 4 | tagSide: string; 5 | tagIndent: string; 6 | multlineWidth: string; 7 | useLabelIds: boolean; 8 | tags: string; 9 | inlineMath: string[][]; 10 | displayMath: string[][]; 11 | processEscapes: boolean; 12 | processEnvironments: boolean; 13 | processRefs: boolean; 14 | maxMacros: number; 15 | maxBuffer: number; 16 | }; 17 | asciimath: { 18 | delimiters: string[][]; 19 | }; 20 | MathML: { 21 | parseAs: string; 22 | forceReparse: boolean; 23 | }; 24 | HTML: { 25 | scale: number; 26 | mathmlSpacing: boolean; 27 | exFactor: number; 28 | }; 29 | SVG: { 30 | fontCache: string; 31 | }; 32 | CHTML: any; 33 | }; 34 | export default MathJaxConfig; 35 | -------------------------------------------------------------------------------- /lib/mathjax/mathJaxConfig.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mathJaxConfig.js","sourceRoot":"","sources":["../../src/mathjax/mathJaxConfig.ts"],"names":[],"mappings":";;AAAA,4DAA4D;AAC5D,IAAM,aAAa,GAAG;IAClB,GAAG,EAAE;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO;YAChI,QAAQ;YACR,aAAa,EAAE,MAAM,CAAC;QAC1B,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,OAAO;QAClB,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,KAAK;QACX,UAAU,EAAE;YACR,6CAA6C;YAC7C,CAAC,GAAG,EAAE,GAAG,CAAC;YACV,CAAC,KAAK,EAAE,KAAK,CAAC;SACjB;QACD,WAAW,EAAE;YACT,6CAA6C;YAC7C,CAAC,IAAI,EAAE,IAAI,CAAC;YACZ,CAAC,KAAK,EAAE,KAAK,CAAC;SACjB;QACD,cAAc,EAAE,IAAI;QACpB,mBAAmB,EAAE,IAAI;QACzB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,2DAA2D;KACnF;IACC,SAAS,EAAE;QACT,UAAU,EAAE,CAAC,CAAC,SAAS,EAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAC,GAAG,CAAC,CAAC;KAChD;IACH,MAAM,EAAE;QACJ,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,IAAI,CAAC,6CAA6C;QAChE,yDAAyD;QACzD,gDAAgD;KACnD;IACD,IAAI,EAAE;QACF,KAAK,EAAE,CAAC;QACR,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,GAAG,CAAC,kEAAkE;KACnF;IACD,GAAG,EAAE;QACD,SAAS,EAAE,MAAM,EAAc,0BAA0B;KAC5D;IACD,KAAK,EAAE,IAAI;CACd,CAAC;AAEF,kBAAe,aAAa,CAAC"} -------------------------------------------------------------------------------- /lib/mathjax/mathjax.d.ts: -------------------------------------------------------------------------------- 1 | import { MathML } from "mathjax-full/js/input/mathml.js"; 2 | import { SVG } from 'mathjax-full/js/output/svg.js'; 3 | import { AsciiMath } from 'mathjax-full/js/input/asciimath.js'; 4 | import 'mathjax-full/js/input/tex/AllPackages.js'; 5 | /** Load configuration for additional package array */ 6 | import './helpers/array/ArrayConfiguration'; 7 | /** Load configuration for additional package icon */ 8 | import './helpers/icon/IconConfiguration'; 9 | export declare const mml: MathML; 10 | export declare const svg: SVG; 11 | export declare const asciimath: AsciiMath; 12 | export declare class MathJaxConfigure { 13 | mTex: any; 14 | tex: any; 15 | texTSV: any; 16 | mathjax: any; 17 | adaptor: any; 18 | domNode: any; 19 | handler: any; 20 | docTeX: any; 21 | docTeXTSV: any; 22 | mDocTeX: any; 23 | docMathML: any; 24 | docAsciiMath: any; 25 | constructor(); 26 | chooseAdaptor: () => void; 27 | initTex: (nonumbers?: boolean) => void; 28 | setHandler: (acssistiveMml?: boolean, nonumbers?: boolean) => void; 29 | changeHandler: (acssistiveMml?: boolean, nonumbers?: boolean) => void; 30 | } 31 | -------------------------------------------------------------------------------- /lib/mathjax/mathml-word.d.ts: -------------------------------------------------------------------------------- 1 | import { SerializedMmlVisitor } from 'mathjax-full/js/core/MmlTree/SerializedMmlVisitor.js'; 2 | import { MmlMover, MmlMunder } from "mathjax-full/js/core/MmlTree/MmlNodes/munderover.js"; 3 | import { TextNode } from "mathjax-full/js/core/MmlTree/MmlNode.js"; 4 | export declare class MathMLVisitorWord extends SerializedMmlVisitor { 5 | options: any; 6 | constructor(options: any); 7 | visitTextNode(node: TextNode, space: string): string; 8 | restructureMtrForAligned(node: any, space: string): string; 9 | visitDefault(node: any, space: string): string; 10 | isSubTable: (node: any) => boolean; 11 | needToAddRow: (node: any) => void; 12 | visitMunderoverNode(node: any, space: string): string; 13 | protected visitMunderNode(node: MmlMunder, space: string): string; 14 | protected visitMoverNode(node: MmlMover, space: string): string; 15 | protected quoteHTML(value: string, replaceAll?: boolean): string; 16 | needConvertToFenced: (node: any) => boolean; 17 | pasteNodeToNewRow: (node: any, space: any) => string; 18 | convertToFenced: (node: any, space: any) => string; 19 | } 20 | -------------------------------------------------------------------------------- /lib/mathjax/my-BaseMappings.d.ts: -------------------------------------------------------------------------------- 1 | declare const sm: any; 2 | declare const ParseMethods_js_1: any; 3 | declare const BaseMethods_js_1: any; 4 | -------------------------------------------------------------------------------- /lib/mathjax/serialized-ascii/common.d.ts: -------------------------------------------------------------------------------- 1 | export interface IAsciiData { 2 | ascii: string; 3 | ascii_tsv: string; 4 | ascii_csv: string; 5 | ascii_md: string; 6 | } 7 | export declare const AddToAsciiData: (data: IAsciiData, arr: Array) => IAsciiData; 8 | export declare const getFunctionNameFromAscii: (ascii: string, node: any) => string; 9 | export declare const hasOnlyOneMoNode: (node: any) => boolean; 10 | -------------------------------------------------------------------------------- /lib/mathjax/serialized-ascii/handlers.d.ts: -------------------------------------------------------------------------------- 1 | import { MmlNode } from "mathjax-full/js/core/MmlTree/MmlNode"; 2 | import { eSymbolType } from "./helperA"; 3 | import { IAsciiData } from "./common"; 4 | export declare const needFirstSpaceBeforeTeXAtom: (node: any) => boolean; 5 | export declare const needLastSpaceAfterTeXAtom: (node: any) => boolean; 6 | export declare const needFirstSpace: (node: any) => boolean; 7 | export declare const getSymbolType: (tag: string, output: string) => "" | eSymbolType; 8 | export declare const SymbolToAM: (tag: string, output: string, atr?: any, showStyle?: boolean) => any; 9 | export declare const FindSymbolReplace: (str: string) => string; 10 | export declare const FindSymbolToAM: (tag: string, output: string, atr?: any) => string; 11 | export declare const getAttributes: (node: MmlNode) => import("mathjax-full/js/core/Tree/Node").PropertyList; 12 | export declare const handle: (node: any, serialize: any) => IAsciiData; 13 | -------------------------------------------------------------------------------- /lib/mathjax/utils.d.ts: -------------------------------------------------------------------------------- 1 | import { LiteElement } from "mathjax-full/js/adaptors/lite/Element"; 2 | export interface IMathDimensions { 3 | containerWidth: string; 4 | widthEx: number; 5 | heightEx: number; 6 | viewBoxHeight: number; 7 | viewBoxHeightAndDepth: number; 8 | } 9 | interface INodeAttributes { 10 | containerWidth: string; 11 | svgViewBox: string; 12 | svgWidth: string; 13 | svgMinWidth: string; 14 | svgHeight: string; 15 | } 16 | export declare const getNodeAttributes: (node: LiteElement | HTMLElement) => INodeAttributes; 17 | export declare const getMathDimensions: (node: LiteElement | HTMLElement) => IMathDimensions; 18 | export {}; 19 | -------------------------------------------------------------------------------- /lib/mathpix-markdown-model/check-formula.d.ts: -------------------------------------------------------------------------------- 1 | export declare const checkFormula: (mathString: string, showTimeLog?: boolean) => string; 2 | -------------------------------------------------------------------------------- /lib/mathpix-markdown-model/html-page.d.ts: -------------------------------------------------------------------------------- 1 | export declare const generateHtmlPage: (title: any, previewHtml: any, styles?: string, fonts?: string) => string; 2 | -------------------------------------------------------------------------------- /lib/mathpix-markdown-model/html-page.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.generateHtmlPage = void 0; 4 | var generateHtmlPage = function (title, previewHtml, styles, fonts) { 5 | if (styles === void 0) { styles = ''; } 6 | if (fonts === void 0) { fonts = ''; } 7 | return "\n\n\n \n ".concat(title, "\n \n ").concat(fonts, "\n ").concat(styles, "\n\n\n
      \n
      \n
      \n ").concat(previewHtml, "\n
      \n
      \n\n"); 8 | }; 9 | exports.generateHtmlPage = generateHtmlPage; 10 | //# sourceMappingURL=html-page.js.map -------------------------------------------------------------------------------- /lib/mathpix-markdown-model/html-page.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"html-page.js","sourceRoot":"","sources":["../../src/mathpix-markdown-model/html-page.ts"],"names":[],"mappings":";;;AAAO,IAAM,gBAAgB,GAAG,UAAC,KAAK,EAAE,WAAW,EAAE,MAAS,EAAE,KAAQ;IAAnB,uBAAA,EAAA,WAAS;IAAE,sBAAA,EAAA,UAAQ;IACtE,OAAO,mGAII,KAAK,yGAEZ,KAAK,mBACL,MAAM,oKAMJ,WAAW,6CAIX,CAAA;AACR,CAAC,CAAC;AAnBW,QAAA,gBAAgB,oBAmB3B"} -------------------------------------------------------------------------------- /lib/sre/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * TODO: Add a handler to reader output "softmax" as a word instead of "s o f t m a x" 3 | * */ 4 | export declare const getSpeech: (sre: any, mml: any) => string; 5 | export declare const addAriaToMathHTML: (sre: any, html: string) => string; 6 | -------------------------------------------------------------------------------- /lib/sre/sre-browser.d.ts: -------------------------------------------------------------------------------- 1 | export declare const loadSre: (options?: {}) => any; 2 | -------------------------------------------------------------------------------- /lib/sre/sre-browser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.loadSre = void 0; 4 | var sre = require("speech-rule-engine/lib/sre.js"); 5 | var loadSre = function (options) { 6 | if (options === void 0) { options = {}; } 7 | var optionsEngine = Object.assign({}, { domain: 'mathspeak' }, options); 8 | sre.setupEngine(optionsEngine); 9 | return sre; 10 | }; 11 | exports.loadSre = loadSre; 12 | //# sourceMappingURL=sre-browser.js.map -------------------------------------------------------------------------------- /lib/sre/sre-browser.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sre-browser.js","sourceRoot":"","sources":["../../src/sre/sre-browser.ts"],"names":[],"mappings":";;;AAAA,mDAAqD;AAE9C,IAAM,OAAO,GAAG,UAAC,OAAY;IAAZ,wBAAA,EAAA,YAAY;IAClC,IAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,OAAO,CAAC,CAAC;IACxE,GAAG,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC/B,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAJW,QAAA,OAAO,WAIlB"} -------------------------------------------------------------------------------- /lib/sre/sre-node.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Note that in asynchronous operation mode for these methods to work correctly, 3 | * it is necessary to ensure that the Engine is ready for processing. 4 | * In other words, you need to wait for the setup promise to resolve. 5 | * */ 6 | export declare const loadSreAsync: (options?: {}) => Promise; 7 | -------------------------------------------------------------------------------- /lib/sre/sre-node.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sre-node.js","sourceRoot":"","sources":["../../src/sre/sre-node.ts"],"names":[],"mappings":";;;;AAAA,IAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC1C;;;;KAIK;AAEE,IAAM,YAAY,GAAG,UAAC,OAAY;IAAZ,wBAAA,EAAA,YAAY;IACvC,OAAO,IAAI,OAAO,CAAC,UAAO,OAAO,EAAE,MAAM;;;YACvC,IAAI;gBACI,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,OAAO,CAAC,CAAC;gBACxE,GAAG,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;gBAE/B,GAAG,CAAC,WAAW,EAAE;qBACd,IAAI,CAAC;oBACJ,OAAO,CAAC,GAAG,CAAC,CAAC;gBACf,CAAC,CAAC;qBACD,KAAK,CAAC,UAAA,GAAG;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,CAAC,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;;;SACF,CAAC,CAAA;AACJ,CAAC,CAAC;AAjBW,QAAA,YAAY,gBAiBvB"} -------------------------------------------------------------------------------- /lib/styles/halpers.d.ts: -------------------------------------------------------------------------------- 1 | export declare const getMaxWidthStyle: (maxWidth?: string, isHideScroll?: boolean) => string; 2 | -------------------------------------------------------------------------------- /lib/styles/halpers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"halpers.js","sourceRoot":"","sources":["../../src/styles/halpers.ts"],"names":[],"mappings":";;;AAAO,IAAM,gBAAgB,GAAG,UAAC,QAAqB,EAAE,YAAoB;IAA3C,yBAAA,EAAA,aAAqB;IAAE,6BAAA,EAAA,oBAAoB;IAC1E,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,EAAE,CAAA;KACV;IACD,OAAO,kCAED,YAAY,GAAG,QAAQ,GAAG,GAAG,8PAa/B,YAAY,CAAC,CAAC,CAAC,uDAAuD,CAAC,CAAC,CAAC,EAAE,yBAE3E,YAAY,CAAC,CAAC,CAAC,8DAA8D,CAAC,CAAC,CAAC,EAAE,mBAClF,YAAY,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,mBAC1E,YAAY,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,mBAC1E,YAAY,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,mBAC1E,YAAY,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,mBAC1E,YAAY,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,mBAC1E,YAAY,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,yBAE1E,YAAY,CAAC,CAAC,CAAC,uDAAuD,CAAC,CAAC,CAAC,EAAE,6BAE3E,YAAY,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,yGAM1E,YAAY,CAAC,CAAC,CAAC,uEAAuE,CAAC,CAAC,CAAC,EAAE,0DAGzF,YAAY,GAAG,QAAQ,GAAG,GAAG,yDAI/B,YAAY,CAAC,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC,EAAE,mBACpE,YAAY,CAAC,CAAC,CAAC,uDAAuD,CAAC,CAAC,CAAC,EAAE,SAC9E,CAAA;AACH,CAAC,CAAC;AA/CW,QAAA,gBAAgB,oBA+C3B"} -------------------------------------------------------------------------------- /lib/styles/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare const resetBodyStyles = "\n body {\n margin: 0;\n line-height: normal;\n }\n"; 2 | export declare const MathpixStyle: (setTextAlignJustify?: boolean, useColors?: boolean, maxWidth?: string, scaleEquation?: boolean, isPptx?: boolean) => string; 3 | export declare const PreviewStyle = "\n #preview {\n font-family: 'CMU Serif', 'Georgia', Helvetica, Arial, sans-serif;\n font-size: 17px;\n visibility: visible;\n word-break: break-word;\n padding: 2.5em;\n max-width: 800px;\n margin: auto;\n box-sizing: content-box;\n }\n\n #preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview strong {\n font-family: 'CMU Serif Bold', 'Georgia', Helvetica, Arial, sans-serif;\n }\n\n #preview i, #preview em {\n font-family: 'CMU Serif Italic', 'Georgia', Helvetica, Arial, sans-serif;\n }\n"; 4 | export declare const TocStyle: (containerName?: string) => string; 5 | -------------------------------------------------------------------------------- /lib/styles/styles-code.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"styles-code.js","sourceRoot":"","sources":["../../src/styles/styles-code.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,4/DAkHzB,CAAC"} -------------------------------------------------------------------------------- /lib/styles/styles-container.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ContainerStyle: (useColors?: boolean) => string; 2 | -------------------------------------------------------------------------------- /lib/styles/styles-container.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"styles-container.js","sourceRoot":"","sources":["../../src/styles/styles-container.ts"],"names":[],"mappings":";;;AAAO,IAAM,cAAc,GAAG,UAAC,SAAgB;IAAhB,0BAAA,EAAA,gBAAgB;IAAK,OAAA,gKAU9C,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,sOAYlC,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,4qBA8C9C,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,4KAQlC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,sCAGlC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,kHAOlC,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,+dA4B9C,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,qGAOnD;AAzHmD,CAyHnD,CAAC;AAzHW,QAAA,cAAc,kBAyHzB"} -------------------------------------------------------------------------------- /lib/styles/styles-fonts.d.ts: -------------------------------------------------------------------------------- 1 | export declare const fontsStyles = "\n @import url('https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,500');\n @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700');\n @import url('https://fonts.googleapis.com/css?family=Inconsolata');\n @import url('https://cdn.mathpix.com/fonts/cmu.css');\n @import url('https://fonts.googleapis.com/css2?family=DM+Mono&display=swap');\n"; 2 | -------------------------------------------------------------------------------- /lib/styles/styles-fonts.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.fontsStyles = void 0; 4 | exports.fontsStyles = "\n @import url('https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,500');\n @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700');\n @import url('https://fonts.googleapis.com/css?family=Inconsolata');\n @import url('https://cdn.mathpix.com/fonts/cmu.css');\n @import url('https://fonts.googleapis.com/css2?family=DM+Mono&display=swap');\n"; 5 | //# sourceMappingURL=styles-fonts.js.map -------------------------------------------------------------------------------- /lib/styles/styles-fonts.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"styles-fonts.js","sourceRoot":"","sources":["../../src/styles/styles-fonts.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,uZAM1B,CAAC"} -------------------------------------------------------------------------------- /lib/styles/styles-lists.d.ts: -------------------------------------------------------------------------------- 1 | export declare const listsStyles = "\n ol.enumerate, ul.itemize {\n padding-inline-start: 40px;\n }\n/* It's commented because counter not supporting to change value \n ol.enumerate.lower-alpha {\n counter-reset: item ;\n list-style-type: none !important;\n }\n .enumerate.lower-alpha > li {\n position: relative;\n }\n .enumerate.lower-alpha > li:before { \n content: \"(\"counter(item, lower-alpha)\")\"; \n counter-increment: item; \n position: absolute;\n left: -47px;\n width: 47px;\n display: flex;\n justify-content: flex-end;\n padding-right: 7px;\n flex-wrap: nowrap;\n word-break: keep-all;\n }\n */\n \n .itemize > li {\n position: relative;\n }\n .itemize > li > span.li_level, .li_enumerate.not_number > span.li_level { \n position: absolute;\n right: 100%;\n white-space: nowrap;\n width: max-content;;\n display: flex;\n justify-content: flex-end;\n padding-right: 10px;\n box-sizing: border-box;\n }\n .li_enumerate.not_number {\n position: relative;\n display: inline-block;\n list-style-type: none;\n }\n"; 2 | -------------------------------------------------------------------------------- /lib/styles/styles-lists.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.listsStyles = void 0; 4 | exports.listsStyles = "\n ol.enumerate, ul.itemize {\n padding-inline-start: 40px;\n }\n/* It's commented because counter not supporting to change value \n ol.enumerate.lower-alpha {\n counter-reset: item ;\n list-style-type: none !important;\n }\n .enumerate.lower-alpha > li {\n position: relative;\n }\n .enumerate.lower-alpha > li:before { \n content: \"(\"counter(item, lower-alpha)\")\"; \n counter-increment: item; \n position: absolute;\n left: -47px;\n width: 47px;\n display: flex;\n justify-content: flex-end;\n padding-right: 7px;\n flex-wrap: nowrap;\n word-break: keep-all;\n }\n */\n \n .itemize > li {\n position: relative;\n }\n .itemize > li > span.li_level, .li_enumerate.not_number > span.li_level { \n position: absolute;\n right: 100%;\n white-space: nowrap;\n width: max-content;;\n display: flex;\n justify-content: flex-end;\n padding-right: 10px;\n box-sizing: border-box;\n }\n .li_enumerate.not_number {\n position: relative;\n display: inline-block;\n list-style-type: none;\n }\n"; 5 | //# sourceMappingURL=styles-lists.js.map -------------------------------------------------------------------------------- /lib/styles/styles-lists.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"styles-lists.js","sourceRoot":"","sources":["../../src/styles/styles-lists.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,0jCA4C1B,CAAC"} -------------------------------------------------------------------------------- /lib/styles/styles-tabular.d.ts: -------------------------------------------------------------------------------- 1 | export declare const tabularStyles: (useColors?: boolean) => string; 2 | -------------------------------------------------------------------------------- /lib/styles/styles-tabular.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"styles-tabular.js","sourceRoot":"","sources":["../../src/styles/styles-tabular.ts"],"names":[],"mappings":";;;AAAO,IAAM,aAAa,GAAG,UAAC,SAAgB;IAAhB,0BAAA,EAAA,gBAAgB;IAAK,OAAA,wVAYzC,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,gCAAgC,uBACxE,SAAS,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,wCAAwC,udAoBzF,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,gCAAgC,qBAC3E,SAAS,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,wCAAwC,6LAU9F;AA5CkD,CA4ClD,CAAC;AA5CW,QAAA,aAAa,iBA4CxB"} -------------------------------------------------------------------------------- /lib/yaml-parser/index.d.ts: -------------------------------------------------------------------------------- 1 | export interface IYamlParserResult { 2 | content: string; 3 | metadata: any; 4 | error?: string; 5 | contentStartLine: number; 6 | } 7 | export declare const yamlParser: (text: string, isAddYamlToHtml?: boolean) => IYamlParserResult; 8 | -------------------------------------------------------------------------------- /src/bundle.tsx: -------------------------------------------------------------------------------- 1 | import { MathpixMarkdownModel as MM } from './mathpix-markdown-model'; 2 | 3 | declare global { 4 | interface Window { 5 | loadMathJax: Function, 6 | markdownToHTML: Function, 7 | render: Function, 8 | mmdYamlToHTML: Function, 9 | renderTitleMmd: Function, 10 | renderAuthorsMmd: Function, 11 | } 12 | } 13 | 14 | export const exportMethods = () => { 15 | window.loadMathJax = MM.loadMathJax; 16 | window.render = MM.render; 17 | window.markdownToHTML = MM.markdownToHTML; 18 | window.mmdYamlToHTML = MM.mmdYamlToHTML; 19 | window.renderTitleMmd = MM.renderTitleMmd; 20 | window.renderAuthorsMmd = MM.renderAuthorsMmd; 21 | }; 22 | 23 | exportMethods(); 24 | -------------------------------------------------------------------------------- /src/components/mathpix-loader/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import {MathpixMarkdownModel as MM} from '../../mathpix-markdown-model' 3 | 4 | export interface PMathpixLoader { 5 | children: React.ReactNode; 6 | notScrolling?: boolean; 7 | textAlignJustify?: boolean; 8 | } 9 | 10 | class MathpixLoader extends React.Component { 11 | /** the state of the component */ 12 | state = { 13 | isReadyToTypeSet: false 14 | }; 15 | 16 | componentDidMount() { 17 | const {notScrolling = false, textAlignJustify = false } = this.props; 18 | const isLoad = MM.loadMathJax(notScrolling, textAlignJustify); 19 | this.setState({isReadyToTypeSet: isLoad}); 20 | } 21 | render() { 22 | if (this.state.isReadyToTypeSet) { 23 | return
      {this.props.children}
      24 | } 25 | return
      Loading
      ; 26 | } 27 | } 28 | 29 | export default MathpixLoader; 30 | -------------------------------------------------------------------------------- /src/contex-menu/menu/consts.ts: -------------------------------------------------------------------------------- 1 | export const classNameContextMenu = 'mmd-context-menu'; 2 | export const classNameMenu = 'mmd-menu'; 3 | export const classNameMenuItem = 'mmd-menu-item'; 4 | export const classNameMenuItemSource = 'mmd-menu-item-source'; 5 | export const SMALL_SCREEN_BREAKPOINT = 580; 6 | 7 | export const heightMenuItem = 52; 8 | export const paddingMenu = 5; 9 | export const paddingMenuBottomSmall = 34; 10 | export const maxWidthMenu = 320; 11 | 12 | export const mathExportTypes = [ 13 | 'latex', 14 | 'asciimath', 15 | 'mathml', 16 | 'mathmlword', 17 | 'tsv', 18 | 'csv', 19 | 'table-markdown', 20 | 'smiles' 21 | ]; 22 | 23 | /** Classes mmd for which the context menu is supported */ 24 | export const mmdClassesForContextMenu = ['inline-tabular', 'MathJax', 'smiles', 'smiles-inline']; 25 | 26 | export enum eMathType { 27 | latex = 'latex', 28 | asciimath = 'asciimath', 29 | mathml = 'mathml', 30 | mathmlword = 'mathmlword', 31 | tsv = 'tsv', 32 | csv = 'csv', 33 | table_markdown = 'table-markdown', 34 | smiles = 'smiles' 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/contex-menu/menu/interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface IMenuPosition { 2 | left?: string, 3 | top?: string, 4 | maxWidth?: string, 5 | className?: string 6 | } 7 | -------------------------------------------------------------------------------- /src/contex-menu/menu/menu-items.ts: -------------------------------------------------------------------------------- 1 | import { mathExportTypes } from "./consts"; 2 | import { createMathMenuItem } from "./menu-item"; 3 | import { parseMmdElement } from "../../helpers/parse-mmd-element"; 4 | 5 | export const mathMenuItems = (el) => { 6 | const items = []; 7 | try { 8 | const res = parseMmdElement(el); 9 | if (!res || !res.length) { 10 | return items; 11 | } 12 | 13 | for (let i = 0; i < mathExportTypes.length; i++) { 14 | const resItem = res.find(item => item.type === mathExportTypes[i]); 15 | if (!resItem) { 16 | continue; 17 | } 18 | 19 | let item = createMathMenuItem(resItem.type, resItem.value); 20 | if (item) { 21 | items.push(item); 22 | } 23 | } 24 | 25 | return items; 26 | } catch (err) { 27 | console.error(err); 28 | return items; 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /src/context-menu.tsx: -------------------------------------------------------------------------------- 1 | import { addListenerContextMenuEvents, removeListenerContextMenuEvents } from './contex-menu'; 2 | 3 | declare global { 4 | interface Window { 5 | addListenerContextMenuEvents: Function, 6 | removeListenerContextMenuEvents: Function, 7 | } 8 | } 9 | 10 | export const exportMethods = () => { 11 | window.addListenerContextMenuEvents = addListenerContextMenuEvents; 12 | window.removeListenerContextMenuEvents = removeListenerContextMenuEvents; 13 | }; 14 | 15 | exportMethods(); 16 | -------------------------------------------------------------------------------- /src/copy-to-clipboard/clipboard.ts: -------------------------------------------------------------------------------- 1 | function createNode(text: string): Element { 2 | const node = document.createElement('pre'); 3 | node.style.width = '1px'; 4 | node.style.height = '1px'; 5 | node.style.position = 'fixed'; 6 | node.style.top = '5px'; 7 | node.textContent = text; 8 | return node; 9 | } 10 | 11 | export function copyNode(node: Element): Promise { 12 | const selection = getSelection(); 13 | if (selection == null) { 14 | return Promise.reject(new Error()) 15 | } 16 | 17 | selection.removeAllRanges(); 18 | 19 | const range = document.createRange(); 20 | range.selectNodeContents(node); 21 | selection.addRange(range); 22 | 23 | document.execCommand('copy'); 24 | selection.removeAllRanges(); 25 | return Promise.resolve(); 26 | } 27 | 28 | export function copyText(text: string): Promise { 29 | if ('clipboard' in navigator) { 30 | return navigator.clipboard.writeText(text) 31 | } 32 | const body = document?.body; 33 | if (!body) { 34 | return Promise.reject(new Error()) 35 | } 36 | const node = createNode(text); 37 | body.appendChild(node); 38 | copyNode(node); 39 | body.removeChild(node); 40 | return Promise.resolve(); 41 | } 42 | -------------------------------------------------------------------------------- /src/helpers/consts.ts: -------------------------------------------------------------------------------- 1 | export const envArraysShouldBeFlattenInTSV = ["array", "gathered", "aligned"]; 2 | -------------------------------------------------------------------------------- /src/helpers/icons/squared-icons.ts: -------------------------------------------------------------------------------- 1 | import { IUnicodeIcon } from "./index"; 2 | 3 | export const squaredIcons: Array = [ 4 | { symbol: "1", alias: "squared_one", name: "squared_digit_one", tags: ["color_squared_one"] }, 5 | { symbol: "2", alias: "squared_two", name: "squared_digit_two", tags: ["color_squared_two"] }, 6 | { symbol: "3", alias: "squared_three", name: "squared_digit_three", tags: ["color_squared_three"] }, 7 | { symbol: "4", alias: "squared_four", name: "squared_digit_four", tags: ["color_squared_four"] }, 8 | { symbol: "5", alias: "squared_five", name: "squared_digit_five", tags: ["color_squared_five"] }, 9 | { symbol: "6", alias: "squared_six", name: "squared_digit_six", tags: ["color_squared_six"] }, 10 | { symbol: "7", alias: "squared_seven", name: "squared_digit_seven", tags: ["color_squared_seven"] }, 11 | { symbol: "8", alias: "squared_eight", name: "squared_digit_eight", tags: ["color_squared_eight"] }, 12 | { symbol: "9", alias: "squared_nine", name: "squared_digit_nine", tags: ["color_squared_nine"] }, 13 | { symbol: "0", alias: "squared_zero", name: "squared_digit_zero", tags: ["color_squared_zero"] }, 14 | ]; 15 | -------------------------------------------------------------------------------- /src/helpers/normalize-link.ts: -------------------------------------------------------------------------------- 1 | import * as mdurl from 'mdurl'; 2 | import * as punycode from 'punycode'; 3 | const RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ]; 4 | 5 | /** 6 | * normalizeLink(url) -> String 7 | * 8 | * Function used to encode link url to a machine-readable format, 9 | * which includes url-encoding, punycode, etc. 10 | **/ 11 | export const normalizeLink = (url) => { 12 | const parsed = mdurl.parse(url, true); 13 | 14 | if (parsed.hostname) { 15 | // Encode hostnames in urls like: 16 | // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` 17 | // 18 | // We don't encode unknown schemas, because it's likely that we encode 19 | // something we shouldn't (e.g. `skype:name` treated as `skype:host`) 20 | // 21 | if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { 22 | try { 23 | parsed.hostname = punycode.toASCII(parsed.hostname); 24 | } catch (er) { /**/ } 25 | } 26 | } 27 | 28 | return mdurl.encode(mdurl.format(parsed)); 29 | }; 30 | -------------------------------------------------------------------------------- /src/helpers/utils.ts: -------------------------------------------------------------------------------- 1 | export const formatMathJaxError = (err, latex, fName = 'MathJax') => { 2 | try { 3 | const validLatex = typeof latex === 'string' ? latex : 'Invalid LaTeX data'; 4 | 5 | if (typeof err === 'object' && err !== null) { 6 | const errorMessage = err.message || 'Unknown error'; 7 | const errorData = { 8 | message: errorMessage, 9 | latex: validLatex 10 | }; 11 | console.log(`[${fName}] ERROR=>`, JSON.stringify(errorData, null, 2)); 12 | } else if (typeof err === 'string') { 13 | console.log(`[${fName}] ERROR=> ${err}`, `\nLaTeX: ${validLatex}`); 14 | } else { 15 | console.log(`[${fName}] ERROR=> Unexpected error type`, err, `\nLaTeX: ${validLatex}`); 16 | } 17 | } catch (e) { 18 | console.log(`[${fName}] ERROR (formatting error)=>`, e); 19 | console.log(`[${fName}] Original Error=>`, err); 20 | console.log(`[${fName}] LaTeX=> ${latex}`); 21 | } 22 | }; -------------------------------------------------------------------------------- /src/markdown/common/counters.ts: -------------------------------------------------------------------------------- 1 | export interface ISize { 2 | widthEx: number, 3 | heightEx: number 4 | } 5 | 6 | export let size: ISize = { 7 | heightEx: 0, 8 | widthEx: 0 9 | } 10 | 11 | export const resetSizeCounter = () => { 12 | size = { 13 | heightEx: 0, 14 | widthEx: 0 15 | } 16 | } 17 | 18 | export const setSizeCounter = (widthEx: number, heightEx: number) => { 19 | size.widthEx += widthEx; 20 | size.heightEx += heightEx; 21 | } 22 | -------------------------------------------------------------------------------- /src/markdown/common/csv.ts: -------------------------------------------------------------------------------- 1 | import { csvSeparatorsDef } from './consts'; 2 | 3 | export const CsvJoin = (csv, options, isSub?): string => { 4 | const {csv_separators = {...csvSeparatorsDef}} = options.outMath; 5 | const { 6 | column = csvSeparatorsDef.column, 7 | row = csvSeparatorsDef.row 8 | } = csv_separators; 9 | if (!csv || csv.length === 0 ) { 10 | return '' 11 | } 12 | if (isSub) { 13 | return csv.map(row => row.join(column)).join(row) 14 | } else { 15 | return csv.map(row => { 16 | row = row.map(cell => escapesCsvField(cell, options)); 17 | return row.join(column) 18 | }).join(row) 19 | } 20 | }; 21 | 22 | export const escapesCsvField = (cell: string, options): string => { 23 | const { csv_separators = {...csvSeparatorsDef} } = options.outMath; 24 | const { toQuoteAllFields = false } = csv_separators; 25 | const regExpDoubleQuotes = /(")/g; 26 | const regExpSymbolsShouldBeEnclosed = /("|,|\r\n|\n|\r)/g; 27 | if (!cell) { 28 | return ''; 29 | } 30 | if (regExpSymbolsShouldBeEnclosed.test(cell)) { 31 | cell = cell.replace(regExpDoubleQuotes, '""'); 32 | return '"' + cell + '"' 33 | } 34 | return toQuoteAllFields ? '"' + cell + '"' : cell; 35 | }; 36 | -------------------------------------------------------------------------------- /src/markdown/common/tsv.ts: -------------------------------------------------------------------------------- 1 | import { tsvSeparatorsDef } from './consts'; 2 | 3 | export const TsvJoin = (tsv, options): string => { 4 | const {tsv_separators = {...tsvSeparatorsDef}} = options.outMath; 5 | const {column, row} = tsv_separators; 6 | if (!tsv || tsv.length === 0 ) { 7 | return '' 8 | } 9 | return tsv.map(row => row.join(column)).join(row) 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /src/markdown/dom-adaptor/index.ts: -------------------------------------------------------------------------------- 1 | import * as domino from '@mathpix/domino'; 2 | 3 | export interface Global { 4 | document: Document; 5 | } 6 | 7 | declare var global: Global; 8 | 9 | export const initDocument = () => { 10 | try{ 11 | document; 12 | } catch (e) { 13 | const domimpl = domino.createDOMImplementation(); 14 | global.document = domimpl.createHTMLDocument(); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /src/markdown/md-chemistry/smiles-drawer/src/UtilityFunctions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Translate the integer indicating the charge to the appropriate text. 3 | * @param {Number} charge The integer indicating the charge. 4 | * @returns {String} A string representing a charge. 5 | */ 6 | export function getChargeText(charge) { 7 | // console.log('in the utility version of getChargeText'); 8 | if (charge === 1) { 9 | return '+' 10 | } else if (charge === 2) { 11 | return '2+'; 12 | } else if (charge === -1) { 13 | return '-'; 14 | } else if (charge === -2) { 15 | return '2-'; 16 | } else { 17 | return ''; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/markdown/md-inline-rule/renewcommand.ts: -------------------------------------------------------------------------------- 1 | import { RuleInline } from 'markdown-it'; 2 | import {parseOneCommand} from "../md-block-rule/renewcommand"; 3 | 4 | 5 | export const reNewCommandInLine: RuleInline = (state, silent) => { 6 | let match: RegExpExecArray; 7 | let startMathPos: number = state.pos; 8 | 9 | const reItem: RegExp = /^(?:renewcommand)/; 10 | 11 | if (state.src.charCodeAt(startMathPos) !== 0x5c /* \ */ ) { 12 | return false; 13 | } 14 | if (silent) { 15 | return false; 16 | } 17 | 18 | startMathPos += 1; 19 | 20 | match = state.src 21 | .slice(startMathPos) 22 | .match(reItem); 23 | if (!match){ return false} 24 | 25 | const endPos = parseOneCommand(state, state.src.slice(startMathPos + match[0].length)); 26 | if (state.md.options && state.md.options.forLatex) { 27 | let token = state.push("renewcommand", "", 0); 28 | token.latex = state.src.slice(startMathPos + match[0].length) 29 | .trim(); 30 | } 31 | state.pos = startMathPos + match[0].length + endPos + 1; 32 | return true; 33 | }; 34 | -------------------------------------------------------------------------------- /src/markdown/md-inline-rule/utils.ts: -------------------------------------------------------------------------------- 1 | export const endTag = (arg: string): RegExp => { 2 | return new RegExp('\\\\end\s{0,}\{(' + arg + ')\}') 3 | }; 4 | 5 | export const includegraphicsTag: RegExp = /\\includegraphics\s{0,}\[?([^}]*)\]?\s{0,}\{([^}]*)\}/; 6 | export const includegraphicsTagB: RegExp = /^\\includegraphics\s{0,}\[?([^}]*)\]?\s{0,}\{([^}]*)\}/; 7 | -------------------------------------------------------------------------------- /src/markdown/md-latex-footnotes/interfaces.ts: -------------------------------------------------------------------------------- 1 | import { Token } from "markdown-it"; 2 | 3 | export interface FootnoteItem { 4 | id?: number, 5 | footnoteId?: number, 6 | count?: number, 7 | content?: string, 8 | tokens?: Array, 9 | numbered?: number, 10 | type?: string, // 'footnote', 11 | lastNumber?: number, 12 | isBlock?: boolean, 13 | counter_footnote?: number, 14 | hasContent?: boolean, 15 | markerId?: number, 16 | textId?: number 17 | } 18 | 19 | export interface FootnoteMeta { 20 | id: number, 21 | footnoteId?: number, 22 | numbered?: number, 23 | lastNumber?: number, 24 | type?: string, // 'footnote', 25 | isBlock?: boolean, 26 | hasContent?: boolean 27 | } 28 | -------------------------------------------------------------------------------- /src/markdown/md-renderer-rules/breaks.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Replacing the default rules to ignore insertion of line breaks after hidden tokens. 3 | * Hidden tokens do not participate in rendering 4 | * */ 5 | export const softBreak = (tokens, idx, options /*, env */) => { 6 | const beforeToken = idx - 1 < 0 ? null : tokens[idx-1]; 7 | if (beforeToken && beforeToken.hidden) { 8 | return ''; 9 | } 10 | if (tokens[idx].hidden) { 11 | return tokens[idx].showSpace 12 | ? ' ' 13 | : tokens[idx].showLineBreak 14 | ? '\n' 15 | : ''; 16 | } 17 | if (options.forPptx) { 18 | return options.breaks ? (options.xhtmlOut ? '
      \n' : '
      \n') : '\n'; 19 | } 20 | return options.breaks ? (options.xhtmlOut ? '
      \n' : '
      \n') : '\n'; 21 | }; 22 | 23 | export const hardBreak = (tokens, idx, options /*, env */) => { 24 | const beforeToken = idx - 1 < 0 ? null : tokens[idx-1]; 25 | if (beforeToken && beforeToken.hidden) { 26 | return ''; 27 | } 28 | if (options.forPptx) { 29 | return options.xhtmlOut ? '
      \n' : '
      \n'; 30 | } 31 | return options.xhtmlOut ? '
      \n' : '
      \n'; 32 | }; 33 | -------------------------------------------------------------------------------- /src/markdown/md-svg-to-base64/convert-scv-to-base64.ts: -------------------------------------------------------------------------------- 1 | import base64 from "./base64"; 2 | 3 | const convertSvgToBase64 = (svgString: string = '', id: string = '') => { 4 | const PREFIX = 'data:image/svg+xml;base64,'; 5 | const base64Encode = PREFIX + base64.encode(svgString); 6 | return id 7 | ? '' 8 | : ''; 9 | }; 10 | 11 | export default convertSvgToBase64; 12 | -------------------------------------------------------------------------------- /src/markdown/mdOptions.ts: -------------------------------------------------------------------------------- 1 | const BAD_PROTO_RE = /^(vbscript|javascript|data):/; 2 | const GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/; 3 | 4 | export const validateLinkEnableFile = (url) => { 5 | // url should be normalized at this point, and existing entities are decoded 6 | const str = url.trim().toLowerCase(); 7 | return BAD_PROTO_RE.test(str) 8 | ? GOOD_DATA_RE.test(str) 9 | ? true 10 | : false 11 | : true; 12 | }; 13 | -------------------------------------------------------------------------------- /src/markdown/mdSetPositionsAndHighlight.ts: -------------------------------------------------------------------------------- 1 | import { MarkdownIt } from 'markdown-it'; 2 | import { setPositions } from "./md-core-rules/set-positions"; 3 | import { 4 | renderMathHighlight, 5 | textHighlight, 6 | codeInlineHighlight, 7 | renderTextUrlHighlight, 8 | captionTableHighlight 9 | } from "./highlight/render-rule-highlights"; 10 | 11 | export default (md: MarkdownIt, options) => { 12 | Object.assign(md.options, options); 13 | /** Set positions to tokens */ 14 | md.core.ruler.push('set_positions', setPositions); 15 | 16 | if (md.options.highlights?.length) { 17 | md.renderer.rules.text = textHighlight; 18 | md.renderer.rules.code_inline = codeInlineHighlight; 19 | md.renderer.rules.textUrl = renderTextUrlHighlight; 20 | md.renderer.rules.inline_math 21 | = md.renderer.rules.display_math 22 | = md.renderer.rules.equation_math 23 | = md.renderer.rules.equation_math_not_number 24 | = renderMathHighlight; 25 | md.renderer.rules.caption_table = captionTableHighlight; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/mathjax/helpers/array/ArrayConfiguration.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration file for the Array package. 3 | */ 4 | 5 | import { Configuration } from 'mathjax-full/js/input/tex/Configuration.js'; 6 | import './ArrayMappings'; 7 | 8 | export const ArrayConfiguration = Configuration.create( 9 | 'array', 10 | { 11 | handler: { 12 | environment: ['array-environment'] 13 | } 14 | } 15 | ); 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/mathjax/helpers/array/ArrayMappings.ts: -------------------------------------------------------------------------------- 1 | import * as sm from 'mathjax-full/js/input/tex/SymbolMap.js'; 2 | import ParseMethods from 'mathjax-full/js/input/tex/ParseMethods.js'; 3 | import ParseUtil from "mathjax-full/js/input/tex/ParseUtil.js"; 4 | import ArrayMethods from './ArrayMethods'; 5 | 6 | /** 7 | * Copied from /mathjax-full/ts/input/tex/ams/AmsMappings.ts 8 | */ 9 | let COLS = function(W: number[]) { 10 | const WW: string[] = []; 11 | for (let i = 0, m = W.length; i < m; i++) { 12 | WW[i] = ParseUtil.Em(W[i]); 13 | } 14 | return WW.join(' '); 15 | }; 16 | 17 | /** 18 | * Environments from the Array package. 19 | */ 20 | new sm.EnvironmentMap('array-environment', ParseMethods.environment, { 21 | array: ['AlignedArray'], 22 | gathered: ['AmsEqnArray', null, null, null, 'c', null, '.5em', 'D'], 23 | aligned: ['AmsEqnArray', null, null, null, 'rlrlrlrlrlrl', 24 | COLS([0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0]), '.5em', 'D'], 25 | }, ArrayMethods); 26 | -------------------------------------------------------------------------------- /src/mathpix-markdown-model/html-page.ts: -------------------------------------------------------------------------------- 1 | export const generateHtmlPage = (title, previewHtml, styles='', fonts='') => { 2 | return ` 3 | 4 | 5 | 6 | ${title} 7 | 8 | ${fonts} 9 | ${styles} 10 | 11 | 12 |
      13 |
      14 |
      15 | ${previewHtml} 16 |
      17 |
      18 | 19 | ` 20 | }; 21 | -------------------------------------------------------------------------------- /src/sre/sre-browser.ts: -------------------------------------------------------------------------------- 1 | import * as sre from 'speech-rule-engine/lib/sre.js'; 2 | 3 | export const loadSre = (options = {}) => { 4 | const optionsEngine = Object.assign({}, {domain: 'mathspeak'}, options); 5 | sre.setupEngine(optionsEngine); 6 | return sre; 7 | }; 8 | -------------------------------------------------------------------------------- /src/sre/sre-node.ts: -------------------------------------------------------------------------------- 1 | const sre = require('speech-rule-engine'); 2 | /** 3 | * Note that in asynchronous operation mode for these methods to work correctly, 4 | * it is necessary to ensure that the Engine is ready for processing. 5 | * In other words, you need to wait for the setup promise to resolve. 6 | * */ 7 | 8 | export const loadSreAsync = (options = {}) => { 9 | return new Promise(async (resolve, reject) => { 10 | try { 11 | const optionsEngine = Object.assign({}, {domain: 'mathspeak'}, options); 12 | sre.setupEngine(optionsEngine); 13 | 14 | sre.engineReady() 15 | .then(() => { 16 | resolve(sre); 17 | }) 18 | .catch(err => { 19 | reject(err); 20 | }); 21 | } catch (err) { 22 | reject(err); 23 | } 24 | }) 25 | }; 26 | -------------------------------------------------------------------------------- /src/styles/styles-fonts.ts: -------------------------------------------------------------------------------- 1 | export const fontsStyles = ` 2 | @import url('https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,500'); 3 | @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700'); 4 | @import url('https://fonts.googleapis.com/css?family=Inconsolata'); 5 | @import url('https://cdn.mathpix.com/fonts/cmu.css'); 6 | @import url('https://fonts.googleapis.com/css2?family=DM+Mono&display=swap'); 7 | `; 8 | -------------------------------------------------------------------------------- /src/styles/styles-lists.ts: -------------------------------------------------------------------------------- 1 | export const listsStyles = ` 2 | ol.enumerate, ul.itemize { 3 | padding-inline-start: 40px; 4 | } 5 | /* It's commented because counter not supporting to change value 6 | ol.enumerate.lower-alpha { 7 | counter-reset: item ; 8 | list-style-type: none !important; 9 | } 10 | .enumerate.lower-alpha > li { 11 | position: relative; 12 | } 13 | .enumerate.lower-alpha > li:before { 14 | content: "("counter(item, lower-alpha)")"; 15 | counter-increment: item; 16 | position: absolute; 17 | left: -47px; 18 | width: 47px; 19 | display: flex; 20 | justify-content: flex-end; 21 | padding-right: 7px; 22 | flex-wrap: nowrap; 23 | word-break: keep-all; 24 | } 25 | */ 26 | 27 | .itemize > li { 28 | position: relative; 29 | } 30 | .itemize > li > span.li_level, .li_enumerate.not_number > span.li_level { 31 | position: absolute; 32 | right: 100%; 33 | white-space: nowrap; 34 | width: max-content;; 35 | display: flex; 36 | justify-content: flex-end; 37 | padding-right: 10px; 38 | box-sizing: border-box; 39 | } 40 | .li_enumerate.not_number { 41 | position: relative; 42 | display: inline-block; 43 | list-style-type: none; 44 | } 45 | `; 46 | -------------------------------------------------------------------------------- /tests/_data/_ascii/_asciiTimes.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | latex: `\\left.\\begin{array}{r}{a}\\\\{-b}\\\\{\\times c}\\\\\\hline\\end{array}\\right.`, 4 | ascii: `a-bxx c`, //vertical math 5 | ascii_old: `{:[a],[-b],[times c]:}` 6 | }, 7 | { 8 | latex: `\\left\\{\\begin{array}{r}{a}\\\\{-b}\\\\{\\times c}\\\\\\hline\\end{array}\\right\\}`, 9 | ascii: `{[a],[-b],[xx c]}`, 10 | ascii_old: `{[a],[-b],[times c]}` 11 | }, 12 | { 13 | latex: `x \\times \\frac{1}{2}y|_{a}^{b}`, 14 | ascii: `x xx(1)/(2)y|_(a)^(b)`, 15 | ascii_old: `x times(1)/(2)y|_(a)^(b)` 16 | }, 17 | //different 18 | { 19 | latex: `\\left \\langle \\frac{1}{2} \\right \\rangle`, 20 | ascii: `(:(1)/(2):)`, 21 | ascii_old: `(1)/(2)` 22 | }, 23 | { 24 | latex: `\\{ \\text{ \\frac{1}{2} } \\}`, 25 | ascii: `{" \\frac{1}{2} "}`, 26 | ascii_old: `{" (1)/(2) "}` 27 | }, 28 | 29 | ]; 30 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_html/_html_05.js: -------------------------------------------------------------------------------- 1 | module.exports = "
      Should be 1 [1].
      \n" + 2 | "
      Should be 5 [5].
      \n" + 3 | "
      Should be 0 [0].
      \n" + 4 | "
      Should be 2 [2].
      \n" + 5 | "
      Should be 6 [6].
      \n" + 6 | "
      Should be 3 [3].
      "; 7 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_01.js: -------------------------------------------------------------------------------- 1 | module.exports = "Footnote marker without text. Auto increment counter to 1 \\footnotemark{} should be 1.\n" + 2 | "\n" + 3 | "Footnote marker with text. Auto increment counter to 2 \\footnotemark{} be 2. \\footnotetext{text should be 2}\n" + 4 | "\n" + 5 | "Auto increment counter to 3 \\footnote{text should be 3}\n" + 6 | "\n" + 7 | "Auto increment counter to 4 \\footnote{text should be 4}\n" + 8 | "\n" + 9 | "Footnote marker without text. Auto increment counter to 5 \\footnotemark{} should be 5.\n" + 10 | "\n" + 11 | "Footnote marker with text. Auto increment counter to 6 \\footnotemark{} should be 6. \\footnotetext{text should be 6}\n" + 12 | "\n" + 13 | "Auto increment counter to 7 \\footnote{text should be 7}\n" + 14 | "\n" + 15 | "Auto increment counter to 8 \\footnote{text should be 8}"; 16 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_02.js: -------------------------------------------------------------------------------- 1 | module.exports = "Automatically-generated footnote marker 1 \\footnote{First footnote should be 1}.\n" + 2 | "\n" + 3 | "Footnote marker set to 11 \\footnote[11]{First footnote should be 11}.\n" + 4 | "\n" + 5 | "Automatically-generated footnote marker 2 \\footnote{First footnote should be 2}.\n" + 6 | "\n" + 7 | "Automatically-generated footnote marker 3 \\footnotemark{} \\footnotetext{Text of footnote with marker 3.}\n" + 8 | "\n" + 9 | "Automatically-generated footnote markers 4 \\footnotemark{}, 5\\footnotemark{} \n" + 10 | "\n" + 11 | "Marker set to 20 \\footnotemark[20]{} \\footnotetext{Text of last footnote marker}\n" + 12 | "\n" + 13 | "\\footnotetext{Text of last footnote marker}\n" + 14 | "\n" + 15 | "\\footnotetext[20]{Text of footnote with marker 20}\n"; 16 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_03.js: -------------------------------------------------------------------------------- 1 | module.exports = "MD footnote marker [^1] should be 1\n" + 2 | "[^1]: MD footnote text should be 1\n" + 3 | "\n" + 4 | "MD inline footnote ^[MD Automatically generated footnote markers work fine!] should be 2.\n" + 5 | "\n" + 6 | "I'm writing to demonstrate use of automatically-generated footnote markers\\footnote{Automatically generated footnote markers work fine!} and footnotes which use a marker value provided to the command\\footnote[42]{...is that the answer to everything?}.\n" + 7 | "\n" + 8 | "\\footnote[-42]{...is that the answer to everything?}.\n" + 9 | "\n" + 10 | "MD inline footnote ^[MD Automatically generated footnote markers work fine!] should be 4.\n" + 11 | "\n" + 12 | "\\footnote[0]{...0 is that the answer to everything?}.\n" + 13 | "\n" + 14 | "\\footnote[0]{q...is that the answer to everything?}.\n" + 15 | "\n" + 16 | "Automatically-generated footnote marker\\footnote{Now, footnote should be 5}.\n" + 17 | "\n" + 18 | "Without text \\footnote{} should be 6\n" + 19 | "\n" + 20 | "[^2] MD footnote [^2] \n" + 21 | "[^2]: MD footnote text should be 7\n" + 22 | "\n" + 23 | "\n" + 24 | "\n" 25 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_04.js: -------------------------------------------------------------------------------- 1 | module.exports = 'Some text1 \\footnotetext{Footnote 1}\n' + 2 | '\n' + 3 | 'Some text2 \\footnotetext{Footnote 2}\n' + 4 | '\n' + 5 | 'Some text3 \\footnotetext[55]{Footnote 3}\n' + 6 | '\n' + 7 | 'Some text4 \\footnotetext{Footnote 4}\n' + 8 | '\n' + 9 | 'Some text5 \\footnotetext{}text\n' + 10 | '\n' + 11 | 'Some text6 \\footnotetext[3]{}text\n' + 12 | '\n' + 13 | 'Some text6 \\footnotetext[3]text\n' + 14 | '\n' + 15 | 'Some text6 \\footnotetext text'; 16 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_05.js: -------------------------------------------------------------------------------- 1 | module.exports = "Should be 1 \\footnotemark{}.\n" + 2 | "\n" + 3 | "Should be 5 \\footnotemark[5]{}.\n" + 4 | "\n" + 5 | "Should be 0 \\footnotemark[].\n" + 6 | "\n" + 7 | "Should be 2 \\footnotemark.\n" + 8 | "\n" + 9 | "Should be 6 \\footnotemark[6].\n" + 10 | "\n" + 11 | "Should be 3 \\footnotemark."; 12 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_08.js: -------------------------------------------------------------------------------- 1 | module.exports = "inline footnote \\footnote{inline}\n" + 2 | "\n" + 3 | "Footnote with block math \\footnote{Footnote with block math:\n" + 4 | "\\[\n" + 5 | "x = \\frac { - b \\pm \\sqrt { b ^ { 2 } - 4 a c } } { 2 a }\n" + 6 | "\\]\n" + 7 | "} n123\n" + 8 | "\n" + 9 | "\\footnote{Footnote with block math:\n" + 10 | "\\[\n" + 11 | "x = \\frac { - b \\pm \\sqrt { b ^ { 2 } - 4 a c } } { 2 a }\n" + 12 | "\\]\n" + 13 | "}\n" + 14 | "\n" + 15 | "Footnote with block math \\footnote{Footnote with block math:\n" + 16 | "$$\n" + 17 | "x = \\frac { - b \\pm \\sqrt { b ^ { 2 } - 4 a c } } { 2 a }\n" + 18 | "$$\n" + 19 | "\n" + 20 | "\\begin{tabular}{|c|c|}\n" + 21 | "\\hline Area (sq. ft) & Number of Bedrooms \\\\\n" + 22 | "\\hline \\( 60 \\leq A<80 \\) & 4 \\\\\n" + 23 | "\\hline \\( 80 \\leq A<100 \\) & 6 \\\\\n" + 24 | "\\hline \\( 100 \\leq A<120 \\) & 5 \\\\\n" + 25 | "\\hline \\( 120 \\leq A<140 \\) & 3 \\\\\n" + 26 | "\\hline \\( 110<\\begin{array}{c}-16 n \\\\\n" + 27 | "1\\end{array} \\) \\\\\n" + 28 | "\\hline\n" + 29 | "\\end{tabular}\n" + 30 | "} next"; 31 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_10.js: -------------------------------------------------------------------------------- 1 | module.exports = "\\footnote[5]{should be 5}\n" + 2 | "\\footnote{should be 1}\n" + 3 | "\\title{Title[^1]}\n" + 4 | "[^1]: footnote text\n" + 5 | "In Snip, You can use the `\\title{}` command wherever you want the title to appear in your document. If pasting LaTeX code into Snip, please note that the `\\maketitle` command will be ignored.\n" + 6 | "\n" + 7 | "\\author{Author[^1]}\n" + 8 | "\n" + 9 | "\\author{Author\\\\can also be\\\\multiline}\n" + 10 | "\n" + 11 | "\\author{\n" + 12 | " First[^1]Last\\\\\n" + 13 | " Department\\\\\n" + 14 | " school\\\\\n" + 15 | " email@edu\n" + 16 | " \\and\n" + 17 | " First Last[^1]\\\\\n" + 18 | " ...\n" + 19 | "}\n" + 20 | "\\footnote{should be 3}\n" + 21 | "\n" + 22 | "\\begin{abstract}\n" + 23 | "[^1] footnote \n" + 24 | "This is the abstract to my paper. You are going to learn a lot in this paper, just you wait. I am going to tell you about all the different LaTeX and Markdown syntax you can use in Snip. \n" + 25 | "\\end{abstract}"; 26 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_11.js: -------------------------------------------------------------------------------- 1 | module.exports = ' Some text\n' + 2 | '\n' + 3 | '\\footnotetext{\n' + 4 | '\\({ }^{*}\\) Equal contribution.\n' + 5 | '}\n' + 6 | '\n' + 7 | '\\footnotetext{\n' + 8 | '\\({ }^{0}\\) Compared to V1, this draft includes better baselines, experiments on GLUE, and more on adapter latency.\n' + 9 | '}\n' + 10 | '\n' + 11 | '\\footnotetext{\n' + 12 | '\\({ }^{1}\\) While GPT-3 175B achieves non-trivial performance with few-shot learning, fine-tuning boosts its performance significantly as shown in Appendix A\n' + 13 | '}\n' + 14 | '\n' + 15 | '\\footnotetext{\n' + 16 | '\\({ }^{*}\\) Equal contribution.\n' + 17 | '\n' + 18 | '\\({ }^{0}\\) Compared to V1, this draft includes better baselines, experiments on GLUE, and more on adapter latency.\n' + 19 | '\n' + 20 | '\\({ }^{1}\\) While GPT-3 175B achieves non-trivial performance with few-shot learning, fine-tuning boosts its performance significantly as shown in Appendix A}\n'; 21 | -------------------------------------------------------------------------------- /tests/_data/_footnotes_latex/_mmd/_mmd_12.js: -------------------------------------------------------------------------------- 1 | module.exports = 'Auto increment counter to 1 \\footnote{text should be 1}\n' + 2 | '\n' + 3 | '\\blfootnotetext{Footnote text without number}\n' + 4 | '\n' + 5 | '\\blfootnotetext{\n' + 6 | '\\({ }^{*}\\) Equal contribution.\n' + 7 | '}\n' + 8 | '\n' + 9 | '\\blfootnotetext{\n' + 10 | '\\({ }^{0}\\) Compared to V1, this draft includes better baselines, experiments on GLUE, and more on adapter latency.\n' + 11 | '}\n' + 12 | '\n' + 13 | '\\blfootnotetext{\n' + 14 | '\\({ }^{1}\\) While GPT-3 175B achieves non-trivial performance with few-shot learning, fine-tuning boosts its performance significantly as shown in Appendix A\n' + 15 | '}\n' + 16 | '\n' + 17 | 'Auto increment counter to 2 \\footnote{text should be 2}\n' + 18 | '\n' + 19 | '\\blfootnotetext{Footnote text without number}\n' + 20 | '\n' + 21 | '\\footnotetext{Footnote text should be 2}\n' + 22 | '\n' + 23 | '\\blfootnotetext{Footnote text without number}'; 24 | -------------------------------------------------------------------------------- /tests/_data/_markdownToHTMLWithSize/fonts/Arial-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/tests/_data/_markdownToHTMLWithSize/fonts/Arial-Bold.ttf -------------------------------------------------------------------------------- /tests/_data/_markdownToHTMLWithSize/fonts/Arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mathpix/mathpix-markdown-it/e967be267c57571b2ce6496cac8cf429639a7a86/tests/_data/_markdownToHTMLWithSize/fonts/Arial.ttf -------------------------------------------------------------------------------- /tests/_footnotes.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | const mmdContent = require("./_data/_footnotes/_mmd"); 6 | const { htmlContent, htmlContentFootnote_compact_refs } = require("./_data/_footnotes/_html"); 7 | 8 | const { JSDOM } = require("jsdom"); 9 | const jsdom = new JSDOM(); 10 | global.window = jsdom.window; 11 | global.document = jsdom.window.document; 12 | global.DOMParser = jsdom.window.DOMParser; 13 | 14 | 15 | describe('Check Footnotes:', () => { 16 | const html = MM.markdownToHTML(mmdContent); 17 | it('Checking result html', (done) => { 18 | html.trim().should.equal(htmlContent); 19 | done(); 20 | }); 21 | MM.texReset(); 22 | }); 23 | 24 | describe('Check Footnotes with compact_refs option set to true:', () => { 25 | const html = MM.markdownToHTML(mmdContent, { 26 | footnotes: { 27 | compact_refs: true 28 | } 29 | }); 30 | it('Checking result html', (done) => { 31 | html.trim().should.equal(htmlContentFootnote_compact_refs); 32 | done(); 33 | }); 34 | MM.texReset(); 35 | }); 36 | -------------------------------------------------------------------------------- /tests/_highlights.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | 6 | const options = { 7 | cwidth: 800, 8 | }; 9 | 10 | const { JSDOM } = require("jsdom"); 11 | const jsdom = new JSDOM(); 12 | global.window = jsdom.window; 13 | global.document = jsdom.window.document; 14 | global.DOMParser = jsdom.window.DOMParser; 15 | 16 | describe('Check mmd highlighting:', () => { 17 | const tests = require('./_data/_highlights/_data'); 18 | tests.forEach(function(test) { 19 | const html = MM.markdownToHTML(test.content, 20 | Object.assign({}, options, { highlights: test.highlights})); 21 | describe('Render mmd highlighting => ' + test.content, () => { 22 | it('Checking result html', (done) => { 23 | html.trim().should.equal(test.html); 24 | done(); 25 | }); 26 | }); 27 | }); 28 | MM.texReset(); 29 | }); 30 | -------------------------------------------------------------------------------- /tests/_icon.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | 6 | const options = { 7 | cwidth: 800, 8 | outMath: { 9 | include_svg: true, 10 | } 11 | }; 12 | 13 | 14 | const { JSDOM } = require("jsdom"); 15 | const jsdom = new JSDOM(); 16 | global.window = jsdom.window; 17 | global.document = jsdom.window.document; 18 | global.DOMParser = jsdom.window.DOMParser; 19 | 20 | 21 | describe('Check Mathjax:', () => { 22 | const tests = require('./_data/_icon/_data'); 23 | tests.forEach(function(test) { 24 | const html = MM.markdownToHTML(test.mmd, options); 25 | describe('mmd => ' + test.mmd, () => { 26 | it('Checking result html', (done) => { 27 | html.trim().should.equal(test.html); 28 | done(); 29 | }); 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /tests/_labels.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | const { getLabelsList } = require('../lib/index'); 6 | 7 | const options = { 8 | cwidth: 800 9 | }; 10 | 11 | 12 | const { JSDOM } = require("jsdom"); 13 | const jsdom = new JSDOM(); 14 | global.window = jsdom.window; 15 | global.document = jsdom.window.document; 16 | global.DOMParser = jsdom.window.DOMParser; 17 | 18 | 19 | describe('Check Theorem environments:', () => { 20 | const tests = require('./_data/_labels/_data'); 21 | tests.forEach(function(test, index) { 22 | const html = MM.markdownToHTML(test.latex, options); 23 | const labelsList = getLabelsList(); 24 | describe('Latex => ' + test.latex, () => { 25 | it('Checking result html', (done) => { 26 | html.trim().should.equal(test.html); 27 | done(); 28 | }); 29 | it('Checking labelsList', (done) => { 30 | JSON.stringify(labelsList).should.equal(JSON.stringify(test.labels)); 31 | done(); 32 | }); 33 | }); 34 | }); 35 | MM.texReset(); 36 | }); 37 | -------------------------------------------------------------------------------- /tests/_lists.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | 6 | const options = { 7 | cwidth: 800, 8 | lineNumbering: true, 9 | htmlTags: true 10 | }; 11 | 12 | 13 | const { JSDOM } = require("jsdom"); 14 | const jsdom = new JSDOM(); 15 | global.window = jsdom.window; 16 | global.document = jsdom.window.document; 17 | global.DOMParser = jsdom.window.DOMParser; 18 | 19 | 20 | describe('Check Lists:', () => { 21 | const tests = require('./_data/_lists/_data'); 22 | tests.forEach(function(test) { 23 | const html = MM.markdownToHTML(test.latex, options); 24 | describe('Latex => ' + test.latex, () => { 25 | it('Checking result html', (done) => { 26 | html.should.equal(test.html); 27 | done(); 28 | }); 29 | }); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /tests/_mathjax.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | 6 | const options = { 7 | cwidth: 800 8 | }; 9 | 10 | 11 | const { JSDOM } = require("jsdom"); 12 | const jsdom = new JSDOM(); 13 | global.window = jsdom.window; 14 | global.document = jsdom.window.document; 15 | global.DOMParser = jsdom.window.DOMParser; 16 | 17 | 18 | describe('Check Mathjax:', () => { 19 | const tests = require('./_data/_mathjax/_data'); 20 | tests.forEach(function(test) { 21 | const html = MM.markdownToHTML(test.latex, options); 22 | describe('Latex => ' + test.latex, () => { 23 | it('Checking result html', (done) => { 24 | html.trim().should.equal(test.svg); 25 | done(); 26 | }); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /tests/_mathml_word.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | const notIncludeSymbols = require('./_ascii'); 4 | 5 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 6 | 7 | 8 | const { JSDOM } = require("jsdom"); 9 | const jsdom = new JSDOM(); 10 | global.window = jsdom.window; 11 | global.document = jsdom.window.document; 12 | global.DOMParser = jsdom.window.DOMParser; 13 | 14 | 15 | describe('Check mathml_word:', () => { 16 | const tests = require('./_data/_mathml_word/_data'); 17 | const options = { 18 | cwidth: 800, 19 | outMath: { 20 | include_mathml_word: true, 21 | include_svg: false, 22 | }}; 23 | tests.forEach(function(test, index) { 24 | const html = MM.render(test.latex_input, options); 25 | const data = MM.parseMarkdownByHTML(html, false); 26 | describe((index + 1) + '. [input_latex] => ' + test.latex_input, () => { 27 | it('Should be return mathml_word =>', function(done) { 28 | data[0].should.have.property('type', 'mathmlword'); 29 | data[0].should.have.property('value', test.mathmlword); 30 | done(); 31 | }); 32 | }); 33 | }); 34 | }); 35 | 36 | 37 | -------------------------------------------------------------------------------- /tests/_nonumbers.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | 6 | const options = { 7 | cwidth: 800, 8 | nonumbers: true 9 | }; 10 | 11 | 12 | const { JSDOM } = require("jsdom"); 13 | const jsdom = new JSDOM(); 14 | global.window = jsdom.window; 15 | global.document = jsdom.window.document; 16 | global.DOMParser = jsdom.window.DOMParser; 17 | 18 | 19 | describe('Check Mathjax with `nonumbers` option:', () => { 20 | const tests = require('./_data/_nonumbers/_data'); 21 | tests.forEach(function(test) { 22 | const html = MM.markdownToHTML(test.latex, options); 23 | describe('Latex => ' + test.latex, () => { 24 | it('Checking result html', (done) => { 25 | html.trim().should.equal(test.html); 26 | done(); 27 | }); 28 | }); 29 | }); 30 | MM.texReset(); 31 | }); 32 | -------------------------------------------------------------------------------- /tests/_pluginText.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | 6 | const options = { 7 | htmlTags: true, 8 | width: 1200, 9 | isDisableEmojiShortcuts: true, 10 | typographer: false, 11 | smiles: { 12 | fontSize: 18.7, 13 | theme: 'light', 14 | isTesting: true, 15 | }, 16 | copyToClipboard: true 17 | }; 18 | 19 | 20 | const { JSDOM } = require("jsdom"); 21 | const jsdom = new JSDOM(); 22 | global.window = jsdom.window; 23 | global.document = jsdom.window.document; 24 | global.DOMParser = jsdom.window.DOMParser; 25 | 26 | describe('Check pluginText:', () => { 27 | const tests = require('./_data/_pluginText/_data'); 28 | tests.forEach(function(test) { 29 | const html = MM.markdownToHTML(test.latex, options); 30 | describe('Latex => ' + test.latex, () => { 31 | it('Checking result html', (done) => { 32 | html.trim().should.equal(test.svg); 33 | done(); 34 | }); 35 | }); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /tests/_refs.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | const { getLabelsList } = require('../lib/index'); 6 | 7 | let options = { 8 | cwidth: 800 9 | }; 10 | 11 | 12 | const { JSDOM } = require("jsdom"); 13 | const jsdom = new JSDOM(); 14 | global.window = jsdom.window; 15 | global.document = jsdom.window.document; 16 | global.DOMParser = jsdom.window.DOMParser; 17 | 18 | 19 | describe('Check \\ref and \\eqref:', () => { 20 | const tests = require('./_data/_refs/_data'); 21 | tests.forEach((test, index) => { 22 | const mmdOptions = Object.assign({}, options, test.options); 23 | const html = MM.markdownToHTML(test.mmd, mmdOptions); 24 | const labelsList = getLabelsList(); 25 | describe('Options => ' + JSON.stringify(test.options), () => { 26 | it('Checking result html. (' + index + ')', (done) => { 27 | html.trim().should.equal(test.html); 28 | done(); 29 | }); 30 | it('Checking labelsList', (done) => { 31 | JSON.stringify(labelsList).should.equal(JSON.stringify(test.labels)); 32 | done(); 33 | }); 34 | }); 35 | MM.texReset(); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /tests/_svgChart.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | const notIncludeSymbols = require('./_ascii'); 4 | 5 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 6 | 7 | const options = { 8 | cwidth: 800, 9 | htmlTags: true 10 | }; 11 | 12 | 13 | 14 | const { JSDOM } = require("jsdom"); 15 | const jsdom = new JSDOM(); 16 | global.window = jsdom.window; 17 | global.document = jsdom.window.document; 18 | global.DOMParser = jsdom.window.DOMParser; 19 | 20 | 21 | describe('SVG. Check parseMarkdownByHTML for Chart:', () => { 22 | const tests = require('./_data/_svg_chart/_data'); 23 | tests.forEach((test, index) => { 24 | const html = MM.markdownToHTML(test.mmd, options); 25 | const data = MM.parseMarkdownByHTML(html, false); 26 | describe('SVG [' + index + ']', () => { 27 | it('Should be length = 1', (done) => { 28 | data.should.have.length(1); 29 | done(); 30 | }); 31 | it('Should be return markdown =>', function(done) { 32 | data[0].should.have.property('type', 'markdown'); 33 | data[0].should.have.property('value', test.markdown); 34 | done(); 35 | }); 36 | }); 37 | }); 38 | }); 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /tests/_svgTable.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | const notIncludeSymbols = require('./_ascii'); 4 | 5 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 6 | 7 | const options = { 8 | cwidth: 800, 9 | htmlTags: true 10 | }; 11 | 12 | 13 | 14 | const { JSDOM } = require("jsdom"); 15 | const tests = require("./_data/_svg_chart/_data"); 16 | const jsdom = new JSDOM(); 17 | global.window = jsdom.window; 18 | global.document = jsdom.window.document; 19 | global.DOMParser = jsdom.window.DOMParser; 20 | 21 | 22 | describe('SVG. Check rendering svg table:', () => { 23 | const tests = require('./_data/_svg_table/_data'); 24 | tests.forEach((test, index) => { 25 | const html = MM.markdownToHTML(test.mmd, options); 26 | describe('SVG [' + index + ']', () => { 27 | it('Should be return html =>', (done)=> { 28 | html.trim().should.equal(test.html.trim()); 29 | done(); 30 | }); 31 | }); 32 | }); 33 | }); 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tests/_theorem.js: -------------------------------------------------------------------------------- 1 | let chai = require('chai'); 2 | let should = chai.should(); 3 | 4 | let MM = require('../lib/mathpix-markdown-model/index').MathpixMarkdownModel; 5 | 6 | const options = { 7 | cwidth: 800 8 | }; 9 | 10 | 11 | const { JSDOM } = require("jsdom"); 12 | const jsdom = new JSDOM(); 13 | global.window = jsdom.window; 14 | global.document = jsdom.window.document; 15 | global.DOMParser = jsdom.window.DOMParser; 16 | 17 | 18 | describe('Check Theorem environments:', () => { 19 | const tests = require('./_data/_theorem/_data'); 20 | tests.forEach(function(test) { 21 | const html = MM.markdownToHTML(test.latex, options); 22 | describe('Latex => ' + test.latex, () => { 23 | it('Checking result html', (done) => { 24 | html.trim().should.equal(test.html); 25 | done(); 26 | }); 27 | }); 28 | }); 29 | MM.texReset(); 30 | }); 31 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "module": "commonjs", 5 | "target": "es5", 6 | "lib": ["es6", "dom"], 7 | "sourceMap": true, 8 | "jsx": "react", 9 | "moduleResolution": "node", 10 | "outDir": "lib", 11 | "rootDir": "src", 12 | "declaration": true, 13 | "forceConsistentCasingInFileNames": true, 14 | "noImplicitReturns": true, 15 | "experimentalDecorators": true, 16 | "noImplicitThis": true, 17 | "importHelpers": true, 18 | "suppressImplicitAnyIndexErrors": true, 19 | "noUnusedLocals": true, 20 | "downlevelIteration": true 21 | }, 22 | "exclude": [ 23 | "examples", 24 | "tests", 25 | "node_modules", 26 | "template", 27 | "lib", 28 | "webpack.config.js", 29 | "webpack.dev.js" 30 | ] 31 | } 32 | --------------------------------------------------------------------------------