asciidoctor / asciidoctor-mathematical

An extension for Asciidoctor that converts the content of STEM blocks and inline macros using Mathematical.
MIT License
50 stars 45 forks source link

Incorrect handling of inline AsciiMath #84

Closed GarkGarcia closed 4 years ago

GarkGarcia commented 4 years ago

This a follow up to https://github.com/asciidoctor/asciidoctor-mathematical/pull/82#issuecomment-632622291. I recently implemented AsciiMath support. It has just been released.

However, I now realize the asciimath inline macro is incorrectly handled. Basically, it is handled in exact the same way the latexmath inline macro is. That means the macro is not processing AsciiMath code, it's actually processing LaTeX directly. In other words, currently the asciimath inline macro is functionally equivalent to the latexmath inline macro. This is an error.

I'm working on a patch, but I may need some help on it. This issue was cause by my inability to comprehend how inline stem blocks are currently handled. I think I've now got things figured out, but I'd like someone to review the patch in detail to make sure the implementation is not broken again.

GarkGarcia commented 4 years ago

It is also worth noting that the asciimath block macro is working correctly.

GarkGarcia commented 4 years ago

This issue could be avoided in the future with the introduction of tests targeting the rendering of the asciimath inline and block macros.

ProgramFan commented 4 years ago

We need to refactor the code now. After a lot of edits, the code is messay.

GarkGarcia commented 4 years ago

Fixed on 050841e.