liffiton / dokuwiki-plugin-mathjax

MathJax plugin for DokuWiki
https://www.dokuwiki.org/plugin:mathjax
12 stars 11 forks source link

Some TeX still not protected from Dokuwiki parsing #5

Closed liffiton closed 11 years ago

liffiton commented 11 years ago

Commit 8c54b56 protects several math environments from Dokuwiki parsing, but it doesn't catch all of them. For example, \begin{equation*} environments are not protected.

Example:

\begin{equation*}
f'' + g''
\end{equation*}

Dokuwiki will see the '' marks and format the text in between as monospace, preventing MathJax from seeing and rendering the TeX.

Ideally, this plugin would be able to parse the MathJax configuration and know exactly which environments to look for and protect, but this is likely too complex, nevermind the fact that much of the configuration can be in a file fetched from the CDN and not in the plugin's configuration. Therefore, it's probably best to simply protect more known TeX math environments. If this plugin is installed, it is highly unlikely that one would be writing TeX math that one wants Dokuwiki to parse.

Workarounds (for now):

1) Protect math environments manually. E.g.,

%%\begin{equation*}
f'' + g''
\end{equation*}%%

2) Stick to already-protected TeX syntax: $ $, $$ $$, \[ \], and \( \)

liffiton commented 11 years ago

Fixed in 8864477.