asciidoctor / asciimath

Asciimath parser
MIT License
24 stars 16 forks source link

Add proper support for '%' and '!' symbols #61

Closed skalee closed 3 years ago

skalee commented 3 years ago

Looks like we did it simultaneously. This addresses the issue #58, which has been just fixed in 17b3711ad848ccfd179c441402626ca2c8adf452. Nevertheless, I'm creating this pull request just in case it contains something worth adding to the master.


pepijnve commented 3 years ago

Your fix, while correct, is a bit more limited than what I implemented. Rather than adding specific symbol table entries I added code that tests 'identifiers' against the regex /[[:alnum]].*/ (i.e. starts with an alphanumeric character). If that matches an identifier is emitted; otherwise an operator is emitted. That's exactly what asciimath.js is doing.

pepijnve commented 3 years ago

Thanks for the contribution though. I've integrated your test case since it covered a more complex case than what I had added.