mquinson / po4a

Maintain the translations of your documentation with ease (PO for anything)
http://po4a.org/
GNU General Public License v2.0
124 stars 61 forks source link

AsciiDoc: comments are ignored, breaking markup #308

Closed paususe closed 2 years ago

paususe commented 3 years ago

Let's say you have something like this valid AsciiDoc in source.adoc:

some text in English
+
// COMMENT THAT WILL CONFUSE PO4A
+
more text in English

This is rendered by AsciiDoc as:

some text in English

more text in English

After AsciiDoc => gettext => AsciiDoc conversion, this is what you get:

some text in English
+
+
more text in English

Now there are two consecutive "+" signs, which AsciiDoc understands as "the first + sign is to join those lines 1 and 3 in the same paragraph, and I am asked to print the second + sign", so it renders like this:

some text in English
+ more text in English

I am attaching a full example.

po4acomments.zip

jnavila commented 3 years ago

It seems that comments management of Po4a does not follow the asciidoc "norm" according to asciidoctor. In the documentation of asciidoctor, it is written that single line comments break the block structures, where as in Po4a tests, a line comment does not split a paragraph.

jnavila commented 3 years ago

In fact, I'm not even sure that the behavior is consistent between asciidoc and asciidoctor here.

mquinson commented 3 years ago

Hello all. @jnavila just commited a potential fix for this issue.

@paususe, could you please confirm that this problem is fixed by the current git version?

Thx,

mquinson commented 2 years ago

@paususe do you think that we could close this bug, or is there any remaining issue? @jnavila what's your feeling here?

Thanks to both of you, Mt

jnavila commented 2 years ago

The changeset passed the modified unittests. But there may be some corner cases in the real world that were missed.

mquinson commented 2 years ago

If so, I think we can close this bug. @paususe feel free to reopen it on need, or to submit another one.

Thanks a lot,