asciidoctor / asciidoctor

:gem: A fast, open source text processor and publishing toolchain, written in Ruby, for converting AsciiDoc content to HTML 5, DocBook 5, and other formats.
https://asciidoctor.org
Other
4.75k stars 789 forks source link

Asciidoctor drops line comments inside a verbatim block inside an AsciiDoc table cell #2496

Open sindzicat opened 6 years ago

sindzicat commented 6 years ago

Hello!

I type:

....
\*stars* +
st\\**a**rs +
\\__func__
// some comment
....

I see in html:

\*stars* +
st\\**a**rs +
\\__func__

But there is no the last line in result. Workarround:

    \*stars* +
    st\\**a**rs +
    \\__func__
    // some comment

But it's a workarround only if you don't need line numbering or syntax highlighting.

It seems for me there is a bug in asciidoctor: it shouldn't parse the last string as a comment.

Best regrads, Andrey.

mojavelinux commented 6 years ago

I'm not observing the same behavior (using 1.5.6.1). Is the literal block inside of an AsciiDoc table cell, by chance?

sindzicat commented 6 years ago

@mojavelinux, sorry, I forgot to tell about this. I thought this doesn't matter. Yes, you are quite right: this code block is in table.

sindzicat commented 6 years ago

Test file:

= Test file
:nofooter:

....
\*stars* +
st\\**a**rs +
\\__func__
// some comment
....

[cols="1*a"]
|===
| Header
|
....
\*stars* +
st\\**a**rs +
\\__func__
// some comment
....
|===

Result: image

So, this problems is only when code block is in table.

sindzicat commented 6 years ago

Please, help me to solve this problem. I can use ++++ to insert raw html, but I'd like to use Asciidocs syntax for this purpose.

mojavelinux commented 5 years ago

This is a parsing bug / quirk we're going to have to find a solution for.

mojavelinux commented 9 months ago

Btw, the workaround is to indent the content in the verbatim block and set indent=0 on the block.

[cols="1*a"]
|===
| Header
|
[indent=0]
....
 \*stars* +
 st\\**a**rs +
 \\__func__
 // some comment
....
|===