Open arthur-shaw opened 9 months ago
I'm seeing the same behavior when I open the file with the Kate editor. This indicates that the problem is in the stata.xml syntax definition from KDE, which skylighting is interpreting accurately. Try submitting a report there (see our README for some links).
Many thanks for pointing me in the right direction.
If this gets fixed upstream, should I notify you here? Or do you periodically pull new/improved syntax definitions from upstream?
Wouldn't hurt to notify here. But yes, every once in a while we pull in changes from upstream.
In Stata's built-in code editor, all text contained in a comment is highlighted as a comment. For example:
In Pandoc outputs, plain text in comments that also happens to be Stata keywords is highlighted as a keyword. For example:
Note that adopath, BASE, means, and until--all incorrectly highlighted words following comments--appear as words to highlight in stata.xml.
When inspecting the HTML output, one can see the keyword class being applied. Furthermore, the text after comments appears to be "tokenized", and each "token" gets a different highlighting style depending what class it belongs to (e.g., keyword, list of commands, etc.)
Here's how I produced the HTML output in the last two images above.
pandoc stata_test.md -f markdown -t html -s -o stata_test.html