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

1.6.0 Regression: Formulas are not rendered within HTML #9

Open
Thunderbolt32 opened this issue Apr 17, 2018 · 1 comment
Open

1.6.0 Regression: Formulas are not rendered within HTML #9

Thunderbolt32 opened this issue Apr 17, 2018 · 1 comment
Labels

Comments

@Thunderbolt32
Copy link

Formulas are not rendered with MathJax if they are enclosed in HTML code.

This (HTML)-code is simply interpreted as HTML code. MathJax does not render the formula.

<p>Test ... $x^2$ ...bla..bla...</p>

This (MarkDown)-code is rendered by MathJax as expected.

Test ... $x^2$ ...bla..bla...

Expected behavior: In both cases formulas are rendered with MathJax.

Regression / Incompatibility with Grav TinyMCE Plug-in (Version 1.5.1 has been compatible with TinyMCE)

@Sommerregen
Copy link
Owner

Hey @Thunderbolt32 ,

well this is because previous versions just rendered math expressions even when they were not preprocessed. This has changed in v1.6.0, more specifically here mathjax.js. You can restore the previous behaviour either by setting built_in_js: false and provide your own mathjax.js in the theme and add

    // Array of pairs of strings that are to be used as in-line math delimiters
    inlineMath: [ ['\\(','\\)'], ['$', '$'] ],
    // Array of pairs of strings that are to be used as delimiters for displayed equations.
    displayMath: [ ['\\[','\\]'], ['$$', '$$']  ],

or set

<p markdown="1">Test ... $x^2$ ...bla..bla...</p>

The attribute invokes the parser to check for markdown tags in the content. You can also switch to \( ... \) for inline and \[ ... \] for block code, which still works as expected (even without the html attribute).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants