Closed 06180339 closed 5 years ago
Thanks @06180339
Could you include unit tests too?
Thank you for this library (latex2mathml)! Sorry for the double-commit; the first one can and probably should be superseded with https://github.com/roniemartinez/latex2mathml/commit/ecb1a59ffc4a697aa404bbdb0e764d24681d02fc
“Could you include unit tests too?”
Yes, thanks for the hint. It will just take some time, sorry.
Thanks @06180339 ,
I'll check on it tonight. (sorry we are on different timezones)
Thank you, roniemartinez. There’s no hurry for me. Maybe the proposed solution is possible, maybe not.
@all-contributors please add @06180339 for code
@roniemartinez
I've put up a pull request to add @06180339! :tada:
Edit: I have a more comprehensive proposal now; please see the next commit https://github.com/roniemartinez/latex2mathml/commit/ecb1a59ffc4a697aa404bbdb0e764d24681d02fc
I don’t fully understand the escaping / unescaping behaviour of the function
convert
, as it is now:With and without this change:
convert('1 < 2')
yields<math><mrow><mn>2</mn><mi><</mi><mn>4</mn></mrow></math>
, which is not well-formed XML. I cannot escape now, because the string already contains the XML tags. I also cannot escape the latex before, becauseconvert('1 < 2')
leads to an undesired result.With this change:
convert('1 < 2', unescaping = False)
yields<math><mrow><mn>2</mn><mi><</mi><mn>4</mn></mrow></math>
, which is well-formed XML.So, the proposed change would provide the possibility of keeping “<”, “>” escaped within the resulting XML.
Maybe the old behaviour is not even needed. The new code perhaps could be then:
without the parameter
unescaping
anywhere.If this is just a misunderstanding, that is not intended.