The current logic relies heavily on regex to manipulate Markdown text.
Problem:
Regex is brittle against complex Markdown (escaped characters, nested spans, etc.).
Solution:
Implement a native Pandoc Lua filter (or a Python filter via panflute) to handle comment spans and milestone markers directly in the AST.
The current logic relies heavily on regex to manipulate Markdown text.
Problem:
Regex is brittle against complex Markdown (escaped characters, nested spans, etc.).
Solution:
Implement a native Pandoc Lua filter (or a Python filter via
panflute) to handle comment spans and milestone markers directly in the AST.