Skip to content
This repository has been archived by the owner on Oct 21, 2018. It is now read-only.

math2html crashes on malformed math #38

Open
niejen opened this issue Feb 18, 2016 · 0 comments
Open

math2html crashes on malformed math #38

niejen opened this issue Feb 18, 2016 · 0 comments

Comments

@niejen
Copy link

niejen commented Feb 18, 2016

To reproduce, copy to rst.ninjs.org:
:math:\frac

This also happens with multiline .. math::

Workarounds for user are either

  1. Keep typing and hit reload when math is parseable (works on firefox)
    or
  2. Leave off last backtick until math is parseable (for multiline, don't add .. math:: till equation is done)

Possible suggestions for resolving (not sure how good):

  • Commit patch to math2html, so unparseable math generates some "best effort" or error message in the html, and throws a level 4 error (which rsted will report, but not crash on). The patch will obviously have to be accepted and propagate downstream before this works
  • Catch level 5 errors in rsted, and handle them. For instance keep a copy of the "last known good" html generated, and keep showing that with an added warning. I guess the call to docutils should be wrapped in some handler function for that. If this is the only known error that needs handling in this way, the wrapper could do it only for errors backtracing to math2html.py
  • Find some docutils setting that works around this (I haven't found anything obvious beyond the already used "level 5" error tolerance)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant