Opened 13 years ago
Last modified 13 years ago
#8853 assigned defect
renders formulas, even when there are no formulas
Reported by: | Martin | Owned by: | Kamil Kisiel |
---|---|---|---|
Priority: | normal | Component: | TracMathJaxPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
On most pages of my Trac installation, there are no mathematical formulas. However, TracMathJaxPlugin treats many things as formulas, which are in fact e.g. Makefile variables. This leads to unreadable diff views and other nasty things.
If I see it correctly, I can only choose between using TracMathJaxPlugin in a Trac installation or not. It would be better if e.g. one could either:
- choose domains in which TracMathJaxPlugin should be used, e.g. "only the wiki" or "wiki and tickets" or "only wiki pages starting with foobar/"
- explicitly mark wiki pages, tickets etc. that contain math, leaving anything else ignored by TracMathJaxPlugin
- use a more complex syntax to specify math, so that it is less likely, that Makefiles or other codes are misinterpreted as mathematical formulas
- switch TracMathJaxPlugin off for certain kind of views, e.g. source code view, diffs, attachments
Attachments (1)
Change History (4)
Changed 13 years ago by
Attachment: | tracmathjax.py.diff added |
---|
comment:1 Changed 13 years ago by
We have the same problem with this plugin. We have put in a crude fix to stop MathJax
being injected to the document when in browser or changeset mode. See attachment:tracmathjax.py.diff.
comment:2 follow-up: 3 Changed 13 years ago by
Status: | new → assigned |
---|
Thanks for the patch. I need to do some more thinking as to how to limit the plugin to certain areas of the document. I don't think just disabling it in the changeset or browser mode is necessarily the best way to do it. For example, changeset messages may contain LaTeX markup that should be rendered correctly, just as other wiki sections are.
One option I could add is to disable the inline MathJax syntax and only allow it to be rendered within macros or text processors. Thoughts?
comment:3 Changed 13 years ago by
Replying to kisielk:
One option I could add is to disable the inline MathJax syntax and only allow it to be rendered within macros or text processors. Thoughts?
Sounds like a good idea. The only drawback is, that people already using the plugin might need to change their wiki pages and tickets. But that's acceptable, IMHO. Definetely better than the current behaviour!
I did not yet try the patch by matthew-dot-shin-at-metoffice-dot-gov-dot-uk, but for my special use case, it is probably sufficient. Thanks!
crude fix