mathpix-markdown-it 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -81
- package/es5/bundle.js +2 -2
- package/es5/index.js +2 -2
- package/lib/components/mathpix-markdown/index.js +2 -1
- package/lib/components/mathpix-markdown/index.js.map +1 -1
- package/lib/markdown/common/consts.d.ts +3 -0
- package/lib/markdown/common/consts.js +8 -5
- package/lib/markdown/common/consts.js.map +1 -1
- package/lib/markdown/common/convert-math-to-html.d.ts +2 -0
- package/lib/markdown/common/convert-math-to-html.js +126 -0
- package/lib/markdown/common/convert-math-to-html.js.map +1 -0
- package/lib/markdown/common/html-re.d.ts +7 -0
- package/lib/markdown/common/html-re.js +88 -0
- package/lib/markdown/common/html-re.js.map +1 -0
- package/lib/markdown/common/mmdRules.js +10 -0
- package/lib/markdown/common/mmdRules.js.map +1 -1
- package/lib/markdown/index.js +2 -1
- package/lib/markdown/index.js.map +1 -1
- package/lib/markdown/md-block-rule/mathml-block.d.ts +2 -0
- package/lib/markdown/md-block-rule/mathml-block.js +68 -0
- package/lib/markdown/md-block-rule/mathml-block.js.map +1 -0
- package/lib/markdown/md-block-rule/mmd-html-block.d.ts +2 -0
- package/lib/markdown/md-block-rule/mmd-html-block.js +96 -0
- package/lib/markdown/md-block-rule/mmd-html-block.js.map +1 -0
- package/lib/markdown/md-inline-rule/html_inline_full_tag.d.ts +2 -0
- package/lib/markdown/md-inline-rule/html_inline_full_tag.js +62 -0
- package/lib/markdown/md-inline-rule/html_inline_full_tag.js.map +1 -0
- package/lib/markdown/md-inline-rule/mathml-inline.d.ts +2 -0
- package/lib/markdown/md-inline-rule/mathml-inline.js +42 -0
- package/lib/markdown/md-inline-rule/mathml-inline.js.map +1 -0
- package/lib/markdown/md-inline-rule2/mmd-html_inline2.d.ts +1 -0
- package/lib/markdown/md-inline-rule2/mmd-html_inline2.js +85 -0
- package/lib/markdown/md-inline-rule2/mmd-html_inline2.js.map +1 -0
- package/lib/markdown/md-latex-footnotes/block-rule.js +42 -12
- package/lib/markdown/md-latex-footnotes/block-rule.js.map +1 -1
- package/lib/markdown/md-renderer-rules/breaks.js +5 -1
- package/lib/markdown/md-renderer-rules/breaks.js.map +1 -1
- package/lib/markdown/mdHighlightCodePlugin.js +1 -0
- package/lib/markdown/mdHighlightCodePlugin.js.map +1 -1
- package/lib/markdown/mdPluginRaw.js +34 -289
- package/lib/markdown/mdPluginRaw.js.map +1 -1
- package/lib/markdown/rules.js +1 -1
- package/lib/markdown/rules.js.map +1 -1
- package/lib/markdown/sanitize/index.js +1 -1
- package/lib/markdown/sanitize/index.js.map +1 -1
- package/lib/mathjax/fix-unicode.d.ts +6 -0
- package/lib/mathjax/fix-unicode.js +38 -0
- package/lib/mathjax/fix-unicode.js.map +1 -0
- package/lib/mathjax/mathJaxConfig.js +2 -1
- package/lib/mathjax/mathJaxConfig.js.map +1 -1
- package/lib/mathjax/mathjax.js +4 -0
- package/lib/mathjax/mathjax.js.map +1 -1
- package/lib/mathpix-markdown-model/index.d.ts +2 -0
- package/lib/mathpix-markdown-model/index.js +2 -1
- package/lib/mathpix-markdown-model/index.js.map +1 -1
- package/lib/styles/index.js +1 -1
- package/lib/styles/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -690,27 +690,28 @@ The `MathpixMarkdown` React element accepts the following props:
|
|
|
690
690
|
|
|
691
691
|
### MathpixMarkdown props
|
|
692
692
|
|
|
693
|
-
| prop
|
|
694
|
-
|
|
695
|
-
| `text`
|
|
696
|
-
| `alignMathBlock`
|
|
697
|
-
| `display`
|
|
698
|
-
| `showTimeLog`
|
|
699
|
-
| `isDisableFancy`
|
|
700
|
-
| `disableRules`
|
|
701
|
-
|
|
|
702
|
-
| `htmlTags`
|
|
703
|
-
| `
|
|
704
|
-
| `
|
|
705
|
-
| `
|
|
706
|
-
| `
|
|
707
|
-
| `
|
|
708
|
-
| `
|
|
709
|
-
| `
|
|
710
|
-
| `
|
|
711
|
-
| `
|
|
712
|
-
| `
|
|
713
|
-
| `
|
|
693
|
+
| prop | type *`default`* | description |
|
|
694
|
+
|--------------------------|------------------------------|------------------------------------------------------------------------------------------------------------------------|
|
|
695
|
+
| `text` | sting | string that will be converted |
|
|
696
|
+
| `alignMathBlock` | string *`center`* | aligns `math-block` by this params |
|
|
697
|
+
| `display` | string *`block`* | `block` - the whole space, `inline-block` - renders in its actual size |
|
|
698
|
+
| `showTimeLog` | boolean *`false`* | shows execution time in console |
|
|
699
|
+
| `isDisableFancy` | boolean *`false`* | `true` - disables processing of special characters (Example: `+ item`, `- item` ) |
|
|
700
|
+
| `disableRules` | array of strings *`[]`* | You can pass a list of rules for markdown rendering that should be disabled but only if `isDisableFancy` is not `true`.|
|
|
701
|
+
| | | Example: `disableRules = ['replacements'] ` will disable fancy characters processing. |
|
|
702
|
+
| `htmlTags` | boolean;*`false`* | Enables HTML tags in source |
|
|
703
|
+
| `htmlDisableTagMatching` | boolean;*`false`* | Allows to turn off the validation that checks for matching opening and closing HTML tags |
|
|
704
|
+
| `xhtmlOut` | boolean;*`false`* | Uses `/` to close single tags (`<br />`) |
|
|
705
|
+
| `breaks` | boolean;*`true`* | Converts `\n` in paragraphs into `<br>` |
|
|
706
|
+
| `typographer` | boolean;*`false`* | Enables some language-neutral replacement + quotes beautification (Example: `(c) (C) (r) (R) (tm) (TM) (p) (P) +-`) |
|
|
707
|
+
| `linkify` | boolean;*`false`* | Autoconverts URL-like text to links |
|
|
708
|
+
| `width` | number;*`1200`* | Sets text container width |
|
|
709
|
+
| `outMath` | [TOutputMath](https://github.com/Mathpix/mathpix-markdown-it#toutputmath);*`{}`* | Sets options to output html |
|
|
710
|
+
| `mathJax` | [TOutputMathJax](https://github.com/Mathpix/mathpix-markdown-it#toutputmathjax);*`{}`* | Sets options to output MathJax |
|
|
711
|
+
| `smiles` | [ISmilesOptions](https://github.com/Mathpix/mathpix-markdown-it#ismilesoptions);*`{}`* | Sets options to output chemistry equation |
|
|
712
|
+
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
|
|
713
|
+
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
|
|
714
|
+
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
|
|
714
715
|
|
|
715
716
|
|
|
716
717
|
## MathpixMarkdownModel methods
|
|
@@ -733,69 +734,71 @@ The `MathpixMarkdown` React element accepts the following props:
|
|
|
733
734
|
|
|
734
735
|
### TMarkdownItOptions
|
|
735
736
|
|
|
736
|
-
|
|
|
737
|
-
|
|
738
|
-
| `isDisableFancy`
|
|
739
|
-
| `disableRules`
|
|
740
|
-
|
|
|
741
|
-
| `htmlTags`
|
|
742
|
-
| `
|
|
743
|
-
| `
|
|
744
|
-
| `
|
|
745
|
-
| `
|
|
746
|
-
| `
|
|
747
|
-
| `
|
|
748
|
-
| `
|
|
749
|
-
| `
|
|
750
|
-
| `
|
|
751
|
-
|
|
|
752
|
-
|
|
|
753
|
-
| `
|
|
754
|
-
| `
|
|
755
|
-
| `
|
|
756
|
-
| `
|
|
757
|
-
| `
|
|
758
|
-
| `
|
|
759
|
-
| `
|
|
760
|
-
| `
|
|
761
|
-
| `
|
|
762
|
-
| `
|
|
763
|
-
| `
|
|
764
|
-
| `
|
|
765
|
-
| `
|
|
737
|
+
| | type *`default`* | description |
|
|
738
|
+
|---------------------------------------|------------------------------|------------------------------------------------------------------------------------------------------------------------|
|
|
739
|
+
| `isDisableFancy` | boolean *`false`* | `true` - disables processing of special characters (Example: `+ item`, `- item` ) |
|
|
740
|
+
| `disableRules` | array of strings *`[]`* | You can pass a list of rules for markdown rendering that should be disabled but only if `isDisableFancy` is not `true`.|
|
|
741
|
+
| | | Example: `disableRules = ['replacements'] ` will disable fancy characters processing. |
|
|
742
|
+
| `htmlTags` | boolean;*`false`* | Enables HTML tags in source |
|
|
743
|
+
| `htmlDisableTagMatching` | boolean;*`false`* | Allows to turn off the validation that checks for matching opening and closing HTML tags |
|
|
744
|
+
| `xhtmlOut` | boolean;*`false`* | Uses `/` to close single tags (`<br />`) |
|
|
745
|
+
| `breaks` | boolean;*`true`* | Converts `\n` in paragraphs into `<br>` |
|
|
746
|
+
| `typographer` | boolean;*`true`* | Enables some language-neutral replacement + quotes beautification (Example: `(c) (C) (r) (R) (tm) (TM) (p) (P) +-`) |
|
|
747
|
+
| `linkify` | boolean;*`true`* | Autoconverts URL-like text to links |
|
|
748
|
+
| `width` | number;*`1200`* | Sets text container width |
|
|
749
|
+
| `lineNumbering` | boolean;*`false`* | Sets line numbers. Recommended for synchronization with a text editor. |
|
|
750
|
+
| `outMath` | [TOutputMath](https://github.com/Mathpix/mathpix-markdown-it#toutputmath);*`{}`* | Sets options to output html |
|
|
751
|
+
| `mathJax` | [TOutputMathJax](https://github.com/Mathpix/mathpix-markdown-it#toutputmathjax);*`{}`* | Sets options to output MathJax |
|
|
752
|
+
| `htmlSanitize` | [THtmlSanitize](https://github.com/Mathpix/mathpix-markdown-it#thtmlsanitize);*`{}`* | Sets html output options (if `htmlTags=true`). Cleans up user html input. |
|
|
753
|
+
| | | Removes script tags and stuff. Removes broken and malicious html. Set to `false` to disable |
|
|
754
|
+
| `smiles` | [ISmilesOptions](https://github.com/Mathpix/mathpix-markdown-it#ismilesoptions);*`{}`* | Sets options to output chemistry equation |
|
|
755
|
+
| `htmlWrapper` | [THtmlWrapper](https://github.com/Mathpix/mathpix-markdown-it#thtmlwrapper);*`{}`* | Sets options for output full html page |
|
|
756
|
+
| `accessibility` | [TAccessibility](https://github.com/Mathpix/mathpix-markdown-it#taccessibility);*`{}`* | Sets options to accessibility |
|
|
757
|
+
| `nonumbers` | boolean;*`false`* | Sets options to prevent equations, tables, figure from being numbered |
|
|
758
|
+
| `showPageBreaks` | boolean;*`false`* | Hidden tags will be shown in html like page break |
|
|
759
|
+
| `centerImages` | boolean;*`true`* | Center align images by default |
|
|
760
|
+
| `centerTables` | boolean;*`true`* | Center align tables by default |
|
|
761
|
+
| `validateLink` | function;*`null`* | The function `(url: string) => void` to override md link validator |
|
|
762
|
+
| `enableCodeBlockRuleForLatexCommands` | boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
|
|
763
|
+
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
|
|
764
|
+
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
|
|
765
|
+
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
|
|
766
|
+
| `copyToClipboard` | boolean;*`false`* | Added copy to clipboard button for code chunks. To handle events, import the function addListenerCopyToClipdoardEvents() from "mathpix-markdown-it/lib/copy-to-clipboard";|
|
|
767
|
+
| `renderOptions` | [RenderOptions](https://github.com/Mathpix/mathpix-markdown-it#renderoptions);*`{}`* | Sets options to enable render rules |
|
|
766
768
|
|
|
767
769
|
### optionsMathpixMarkdown
|
|
768
770
|
|
|
769
|
-
|
|
|
770
|
-
|
|
771
|
-
| `alignMathBlock`
|
|
772
|
-
| `display`
|
|
773
|
-
| `showTimeLog`
|
|
774
|
-
| `isDisableFancy`
|
|
775
|
-
| `disableRules`
|
|
776
|
-
|
|
|
777
|
-
| `htmlTags`
|
|
778
|
-
| `
|
|
779
|
-
| `
|
|
780
|
-
| `
|
|
781
|
-
| `
|
|
782
|
-
| `
|
|
783
|
-
| `
|
|
784
|
-
| `
|
|
785
|
-
| `
|
|
786
|
-
|
|
|
787
|
-
|
|
|
788
|
-
| `
|
|
789
|
-
| `
|
|
790
|
-
| `
|
|
791
|
-
| `
|
|
792
|
-
| `
|
|
793
|
-
| `
|
|
794
|
-
| `
|
|
795
|
-
| `
|
|
796
|
-
| `
|
|
797
|
-
| `
|
|
798
|
-
| `
|
|
771
|
+
| | type *`default`* | description |
|
|
772
|
+
|---------------------------------------|------------------------------|------------------------------------------------------------------------------------------------------------------------|
|
|
773
|
+
| `alignMathBlock` | string *`center`* | aligns `math-block` |
|
|
774
|
+
| `display` | string *`block`* | `block` - the whole space, `inline-block` - renders in its actual size |
|
|
775
|
+
| `showTimeLog` | boolean *`false`* | shows execution time in console |
|
|
776
|
+
| `isDisableFancy` | boolean *`false`* | `true` - disables processing of special characters (Example: `+ item`, `- item` ) |
|
|
777
|
+
| `disableRules` | array of strings *`[]`* | You can pass a list of rules for markdown rendering that should be disabled but only if `isDisableFancy` is not `true`.|
|
|
778
|
+
| | | Example: `disableRules = ['replacements'] ` will disable fancy characters processing. |
|
|
779
|
+
| `htmlTags` | boolean;*`false`* | Enables HTML tags in source |
|
|
780
|
+
| `htmlDisableTagMatching` | boolean;*`false`* | Allows to turn off the validation that checks for matching opening and closing HTML tags |
|
|
781
|
+
| `xhtmlOut` | boolean;*`false`* | Uses `/` to close single tags (`<br />`) |
|
|
782
|
+
| `breaks` | boolean;*`true`* | Converts `\n` in paragraphs into `<br>` |
|
|
783
|
+
| `typographer` | boolean;*`true`* | Enables some language-neutral replacement + quotes beautification (Example: `(c) (C) (r) (R) (tm) (TM) (p) (P) +-`) |
|
|
784
|
+
| `linkify` | boolean;*`true`* | Autoconverts URL-like text to links |
|
|
785
|
+
| `width` | number;*`1200`* | Sets text container width |
|
|
786
|
+
| `outMath` | [TOutputMath](https://github.com/Mathpix/mathpix-markdown-it#toutputmath);*`{}`* | Sets options to output html |
|
|
787
|
+
| `mathJax` | [TOutputMathJax](https://github.com/Mathpix/mathpix-markdown-it#toutputmathjax);*`{}`* | Sets options to output MathJax |
|
|
788
|
+
| `htmlSanitize` | [THtmlSanitize](https://github.com/Mathpix/mathpix-markdown-it#thtmlsanitize);*`{}`* | Sets html output options (if `htmlTags=true`). Cleans up user html input. |
|
|
789
|
+
| | | Removes script tags and stuff. Removes broken and malicious html. Set to `false` to disable |
|
|
790
|
+
| `smiles` | [ISmilesOptions](https://github.com/Mathpix/mathpix-markdown-it#ismilesoptions);*`{}`* | Sets options to output chemistry equation |
|
|
791
|
+
| `nonumbers` | boolean;*`false`* | Sets options to prevent equations, tables, figure from being numbered |
|
|
792
|
+
| `showPageBreaks` | boolean;*`false`* | Hidden tags will be shown in html like page break |
|
|
793
|
+
| `centerImages` | boolean;*`true`* | Center align images by default |
|
|
794
|
+
| `centerTables` | boolean;*`true`* | Center align tables by default |
|
|
795
|
+
| `validateLink` | function;*`null`* | The function `(url: string) => void` to override md link validator |
|
|
796
|
+
| `enableCodeBlockRuleForLatexCommands` | boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
|
|
797
|
+
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
|
|
798
|
+
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
|
|
799
|
+
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
|
|
800
|
+
| `copyToClipboard` | boolean;*`false`* | Added copy to clipboard button for code chunks. To handle events, import the function addListenerCopyToClipdoardEvents() from "mathpix-markdown-it/lib/copy-to-clipboard";|
|
|
801
|
+
| `renderOptions` | [RenderOptions](https://github.com/Mathpix/mathpix-markdown-it#renderoptions);*`{}`* | Sets options to enable render rules |
|
|
799
802
|
|
|
800
803
|
### TOutputMath
|
|
801
804
|
|