Re: Ongoing effort for LibreOffice/Packt backend
Posted by
mojavelinux on
Jun 19, 2014; 5:30am
URL: https://discuss.asciidoctor.org/Ongoing-effort-for-LibreOffice-Packt-backend-tp1823p1839.html
This pesky issue has to do with the fact that inline parsing in AsciiDoc / Asciidoctor is done using sequential regular expression across the whole line. The double underscores in the style name get interpreted as (unconstrained) emphasis markup. We'll eventually fix this problem in Asciidoctor by using a proper parser for inline formatting. Until then, we have to work around it.
One workaround is to escape the double underscore. To know when to escape output, you need to be aware of the order in which the markup is parsed. See the following collection for that order:
As you can see, the unconstrained emphasis follows the processing of strong.
You may run into cases that are chicken-egg. In that case, you might want to use placeholder style names and then come back and replace them...or you can post-process the output to remove any backslashes left behind in style names. There's always a cure :)