Skip to content

Braille highlight crash bug #440

@NSoiffer

Description

@NSoiffer

The following MathML causes a string alignment error in the braille highlighting code:

thread 'main' (28060) panicked at src\braille.rs:124:38:
byte index 2 is not a char boundary; it is inside '🍎' (bytes 0..4) of `🍎🍐⠘⠆⠀⣍⠭

This is for Nemeth. It does not happen with UEB.

<math>
  <mtable>
    <mtr><mtd><mrow><mtext>🍎</mtext><msup><mtext>🍐</mtext><mn>2</mn></msup></mrow></mtd></mtr>
    <mtr><mtd><mi>x</mi></mtd></mtr>
  </mtable>
</math>

This is narrowed down from a larger example. It seems to require the two lines of a table to be triggered (which likely inserts some things at the start of the line).

Note: some efficiency hacks assume the number of bytes/char in some cases and that is probably the problem.

Update: the problem is that the emoji are unknown to MathCAT and they are flowing through into the braille instead of being converted to braille dots. So the real problem is what to do with characters that are not part of the Unicode YAML files. This potentially affects all braille codes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions