Don't use protected in math mode

Issue #110 new
Pieter Belmans
created an issue

At the moment, if rich text contains a {} in math mode it will also get the protected treatment (e.g. for HTML a <span> will be inserted, for plaintext it will be removed).

This is not quite the desired behaviour though: in HTML one will probably use MathJax for the rendering, and then missing brackets is a problem.

A possible solution would be to just ignore math mode when parsing a string. More ideally one could implement a new rich text class, and e.g. use asciiMath or some human-readable format when outputting to plaintext.

I'll have a go at the first solution one of these days.

Comments (1)

  1. Pieter Belmans reporter

    Attached is the quickest solution to this problem. Some obvious issues are: no dealing with \$, no dealing with \( and \) as means to a math mode, no explicit check on math mode being closed at the end of the string.

    For the somewhat non-trivial use case I have in mind this solution is good enough.

  2. Log in to comment