Closed mia1024 closed 6 years ago
Ironically, it seems github has the same problem
There's not much we can do about this, sadly. The syntax highlighting engine currently used by Atom (as well as on GitHub) is restricted to processing one line at a time. Meaning there's no easy way to tell if the current line is the start of a raw:: html
block, or the start of an ordinary block which follows a raw::html
block
Ironically, it seems github has the same problem
Well, it isn't ironic if GitHub is using this very grammar for highlighting reStructuredText. ;)
I just noticed that in atom, the syntax highlighting for math
directive is behaving as expected. For example,
.. math::
f'(x)=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x}
In contrast, without the math directive:
f'(x)=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x}
Or
.. math::
f'(x)=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x}
f'(x)=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x}
All the LaTeX commands are highlighted within the math block, even though there is one (or, in fact, more) blank line following the math
directive. So I would imagine there is a way to make raw
directive to function similarly?
Hey mate,
It's quite possible, although I'm unable to look into it at present. A PR would be warmly welcomed in the meantime, assuming I don't get around to it sooner or later. =)
The ..raw:: html
directive should color fine now on master.
Will cut a release shortly.
I noticed the rule for raw directive syntax highlighting is not right. For example, the correct way to write something in raw
html
is:However, in atom this won't trigger the html syntax highlighting, which only happens when i write like this (without the blank line, which is incorrect):