[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] The + character creating strike-through markup within in-line li
Re: [O] The + character creating strike-through markup within in-line literal / code blocks
Mon, 25 Jun 2018 08:29:42 -0400
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
John Magolske <address@hidden> writes:
>> It happens because syntax coloring is a bit dumb. It uses regexps but
>> not the parser. However, if you try, e.g., to export the document, the
>> plus signs will not be treated as markers.
> Ok, just tried org-html-export-as-html and see it renders properly
> in html:
> ... expression <code>(x +. y)</code> the <code>+.</code> is ...
> but I feel like there's a bug in the regex, that the =code= and
> ~verbatim~ marker characters should be able to prevent any other
> marker characters bracketed by them from causing highlighting.
Regexes recognize what is called a "regular" language which obeys a
context-free grammar. Although modern regexes are a bit more powerful,
it is still difficult (and computationally expensive) to have them
recognize context (e.g. figure out that we are now inside a verbatim
environment and so we need to do things differently). That's why
context-sensitive grammars require parsers.
"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler