Skip to content

Commit edf6433

Browse files
authored
Merge pull request #325 from Mathpix/dev/olga/Add-the-ability-to-disable-Markdown-rules
PR into master from dev/olga/Add-the-ability-to-disable-Markdown-rules
2 parents 1982fae + 9a56b31 commit edf6433

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4776
-88
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ The `MathpixMarkdown` React element accepts the following props:
762762
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
763763
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
764764
| `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";|
765+
| `renderOptions` | [RenderOptions](https://github.com/Mathpix/mathpix-markdown-it#renderoptions);*`{}`* | Sets options to enable render rules |
765766

766767
### optionsMathpixMarkdown
767768

@@ -794,6 +795,7 @@ The `MathpixMarkdown` React element accepts the following props:
794795
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
795796
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
796797
| `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";|
798+
| `renderOptions` | [RenderOptions](https://github.com/Mathpix/mathpix-markdown-it#renderoptions);*`{}`* | Sets options to enable render rules |
797799

798800
### TOutputMath
799801

@@ -875,6 +877,14 @@ The `MathpixMarkdown` React element accepts the following props:
875877
|----------------|-----------------------------|-------------------------------------------|
876878
| `fontSize` | string *`unset`* | Ability to change font size for footnotes |
877879

880+
### RenderOptions
881+
882+
| | type *`default`* | |
883+
|-----------------------------------|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
884+
| `enable_markdown` | boolean *`true`* | Enable markdown rules. If it is set to `false`, then all markdown rules will be disabled. This also disables the rules for `enable_markdown_mmd_extensions`. |
885+
| `enable_latex` | boolean *`true`* | Enable latex rules. If it is set to `false`, then all latex and math rules will be disabled. |
886+
| `enable_markdown_mmd_extensions` | boolean *`true`* | Enable markdown mmd extensions rules: `smiles`, `asciiMath`, `mathML`. If it is set to `false` then these rules will be disabled. |
887+
878888
### TAccessibility
879889

880890
| | type *`default`* | description

es5/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

es5/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/components/mathpix-markdown/index.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/components/mathpix-markdown/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import MathpixLoader from './components/mathpix-loader';
22
import MathpixMarkdown from './components/mathpix-markdown';
33
import { mathpixMarkdownPlugin, initMathpixMarkdown } from './markdown/mathpix-markdown-plugins';
44
import { mdPluginMathJax, mdPluginHighlightCode, mdPluginText, mdPluginTOC, mdPluginAnchor, mdPluginTableTabular, mdPluginList, mdPluginChemistry, mdPluginCollapsible, mdLatexFootnotes, mdSetPositionsAndHighlight } from "./markdown/mdPluginConfigured";
5-
import { MathpixMarkdownModel, TMarkdownItOptions, optionsMathpixMarkdown, TOutputMath, TOutputMathJax, THtmlSanitize, TTocStyle, THighlight, ParserErrors, CodeHighlight, Footnotes } from "./mathpix-markdown-model";
5+
import { MathpixMarkdownModel, TMarkdownItOptions, optionsMathpixMarkdown, TOutputMath, TOutputMathJax, THtmlSanitize, TTocStyle, THighlight, ParserErrors, CodeHighlight, Footnotes, RenderOptions } from "./mathpix-markdown-model";
66
import { ISmilesOptions } from './markdown/md-chemistry';
77
import { resetTheoremEnvironments } from './markdown/md-theorem/helper';
88
import { rest_mmd_footnotes_list } from './markdown/md-latex-footnotes/utils';
99
import { FootnoteItem } from './markdown/md-latex-footnotes/interfaces';
1010
import { eLabelType, ILabel, getLabelsList, getLabelByKeyFromLabelsList, clearLabelsList } from "./markdown/common/labels";
1111
import { normalizeLink } from './helpers/normalize-link';
12-
export { MathpixLoader, MathpixMarkdown, MathpixMarkdownModel, mathpixMarkdownPlugin, mdPluginCollapsible, mdLatexFootnotes, mdSetPositionsAndHighlight, initMathpixMarkdown, mdPluginMathJax, mdPluginHighlightCode, mdPluginText, mdPluginTOC, mdPluginAnchor, mdPluginTableTabular, mdPluginList, mdPluginChemistry, TMarkdownItOptions, optionsMathpixMarkdown, TOutputMath, TOutputMathJax, THtmlSanitize, ISmilesOptions, resetTheoremEnvironments, rest_mmd_footnotes_list, FootnoteItem, TTocStyle, THighlight, CodeHighlight, ParserErrors, Footnotes, eLabelType, ILabel, getLabelsList, getLabelByKeyFromLabelsList, clearLabelsList, normalizeLink };
12+
export { MathpixLoader, MathpixMarkdown, MathpixMarkdownModel, mathpixMarkdownPlugin, mdPluginCollapsible, mdLatexFootnotes, mdSetPositionsAndHighlight, initMathpixMarkdown, mdPluginMathJax, mdPluginHighlightCode, mdPluginText, mdPluginTOC, mdPluginAnchor, mdPluginTableTabular, mdPluginList, mdPluginChemistry, TMarkdownItOptions, optionsMathpixMarkdown, TOutputMath, TOutputMathJax, THtmlSanitize, ISmilesOptions, resetTheoremEnvironments, rest_mmd_footnotes_list, FootnoteItem, TTocStyle, THighlight, CodeHighlight, ParserErrors, Footnotes, eLabelType, ILabel, getLabelsList, getLabelByKeyFromLabelsList, clearLabelsList, normalizeLink, RenderOptions };

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/markdown/common/consts.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { RenderOptions } from "../../mathpix-markdown-model";
12
export declare const attr_value: string;
23
export declare const attribute: string;
34
export declare const openTagMML: RegExp;
@@ -127,3 +128,4 @@ export declare const codeHighlightDef: {
127128
auto: boolean;
128129
code: boolean;
129130
};
131+
export declare const renderOptionsDef: RenderOptions;

0 commit comments

Comments
 (0)