Login  Register

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:

https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor.rb#L1120

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 :)

-Dan


On Wed, Jun 18, 2014 at 6:35 PM, gregturn [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I ran into a pesky issue with one of my styles, used to wrap a **bolded** chunk of text.

For some reason, the styles double-underscore is the culprit.

See https://github.com/gregturn/asciidoc-packt/pull/12


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Ongoing-effort-for-LibreOffice-Packt-backend-tp1823p1837.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | http://google.com/profiles/dan.j.allen