asnunes / mathml-to-latex

A JavaScript tool to convert mathml string to LaTeX equation string.
MIT License
51 stars 14 forks source link

Issue in Safari browser #4

Closed Suhovft49 closed 2 years ago

Suhovft49 commented 3 years ago
ErrorHandler.prototype._mathGenericMissingValue = function () {
        return /(?<=\<.*)(\w+=(?!(\"|\')))/gm;
};

Result: Invalid regular expression: invalid group specifier name

It happens because Safari doesn't support lookbehind yet

asnunes commented 3 years ago

Hi, @Suhovft49! Thank you for your report! I can't see another way to offer support to non lookbehind browsers right now. This feature handle invalid tags like

<root>
  <math>
  <mfenced open='{' close= >
    <mn>3</mn>
  </mfenced>
  </math>
</root>

where open attributes like close= could cause parse errors and so are replaced by an empty string. This use case is covered by our tests. If you want to fix that, fell free to open a PR.

github-actions[bot] commented 3 years ago

Closing due to inactivity

asnunes commented 3 years ago

Reopening due to #9

asnunes commented 2 years ago

9 from @caleb-flores has been merged fixing the problem