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

math2html crashes on malformed math #38

@niejen

Description

@niejen

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions