Hi,
in a document of mine there is a sentence (in German) with some Java code in it: """ Erläutern Sie den Unterschied von `int a = n++;` zu `int a = ++n;`! """ The backticks seem to interfere with the Asciidoctor parser. In the HTML output the double plus characters disappeared. Is there a workaround for this? I did some experiments but couldn't find a solution. Thanks a lot! Cheers, Dominikus
Twitter: @denkspuren
|
Administrator
|
The backticks aren't the problem. ++ has special meaning in AsciiDoc, which means "passthrough" without constraint. If you mean to write a literal ++, you should almost always use a reference to the built-in attribute plus (i.e., {plus}). Erläutern Sie den Unterschied von `int a = n{plus}{plus};` zu `int a = {plus}{plus}n;`! To make this simpler, you can define the attribute "pp" to mean ++. :pp: ++ Erläutern Sie den Unterschied von `int a = n{pp};` zu `int a = {pp}n;`! Alternatively, it's possible to escape the ++ using backslashes, but escaping in AsciiDoc is context-sensitive and thus much trickier to get right. I recommend using the attribute reference instead. -Dan On Wed, Mar 15, 2017 at 8:27 AM, denkspuren [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi, Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Administrator
|
In reply to this post by denkspuren
Your message made me realize that the converter is introducing stray characters when handling an escaped uncontrained passthrough. The following should work, but won't until 1.5.6 is released. Erläutern Sie den Unterschied von `int a = n\++;` zu `int a = ++n;`! -Dan On Wed, Mar 15, 2017 at 2:54 PM, Dan Allen <[hidden email]> wrote:
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
In reply to this post by mojavelinux
Thanks a lot for the workaround, Dan!
I tried escaping ++ with a backslash but that didn't work either. As you mentioned in your follow-up email, you are going to change that. Thx! Your workaround is a great fix for the time being. BTW, I'm using asciidoctor almost daily. It's a really great tool I love working with! /Dominikus
Twitter: @denkspuren
|
Administrator
|
Great to here you got it working!
Yep, fixed in master.
Thanks for the praise! I really enjoy hearing these stories from users. It's what keeps me motivated to make progress every day! Cheers, |
Free forum by Nabble | Edit this page |