Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR into master from dev/olga/199-Add-new-include-wolfram-layer-with-wolfram-output-v2 #199 #202

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion es5/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion es5/context-menu.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion es5/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/react-app/use-parseMarkdownByHTML-method/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
15 changes: 13 additions & 2 deletions examples/react-app/use-parseMarkdownByHTML-method/src/form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ConvertForm extends React.Component {
super(props);
this.state = {
value: '\\[\n' +
'y = \\frac { \\sum _ { i } w _ { i } y _ { i } } { \\sum _ { i } w _ { i } } , i = 1,2 \\ldots k\n' +
'2 - \\sqrt [ 6 ] { \\frac { x ^ { 6 } y ^ { 5 } } { x ^ { 2 } } } \\times \\sqrt [ 6 ] { \\frac { x ^ { 3 } y ^ { 5 } } { x y ^ { 4 } } }\n' +
'\\]' +
'\n' +
'\n' +
Expand All @@ -22,6 +22,7 @@ class ConvertForm extends React.Component {
result: '',
include_mathml: true,
include_asciimath: true,
include_wolfram: true,
include_latex: true,
include_svg: true,
include_tsv: true,
Expand Down Expand Up @@ -54,6 +55,7 @@ class ConvertForm extends React.Component {
outMath: {
include_mathml: this.state.include_mathml,
include_asciimath: this.state.include_asciimath,
include_wolfram: this.state.include_wolfram,
include_latex: this.state.include_latex,
include_svg: this.state.include_svg,
include_tsv: this.state.include_tsv,
Expand All @@ -62,6 +64,7 @@ class ConvertForm extends React.Component {
};
const html = MM.markdownToHTML(this.state.value, options);
const formats = MM.parseMarkdownByHTML(html);
console.log("formats=>",formats);
this.setState({result: html})
this.setState({formats: formats})
}
Expand Down Expand Up @@ -91,6 +94,14 @@ class ConvertForm extends React.Component {
onChange={this.handleInputChange} />
asciimath
</label>
<label>
<input
name="include_wolfram"
type="checkbox"
checked={this.state.include_wolfram}
onChange={this.handleInputChange} />
wolfram
</label>
<label>
<input
name="include_latex"
Expand Down Expand Up @@ -132,7 +143,7 @@ class ConvertForm extends React.Component {
<div className="formats">
{this.state.formats && this.state.formats.length > 0 &&
this.state.formats.map((item, index) => {
return <div className="item">
return <div className="item" key={index}>
<div>{item.type}</div>
<code>{item.value}</code>
</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/helpers/parse-mmd-element.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/helpers/parse-mmd-element.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/mathjax/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export declare const MathJax: {
mathml?: string;
mathml_word?: string;
asciimath?: string;
wolfram?: string;
latex?: string;
svg?: string;
speech?: string;
Expand Down
29 changes: 26 additions & 3 deletions lib/mathjax/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading