Closed joelnitta closed 1 year ago
Hello,
I think that the syntax of your file is to blame. Have a look at the syntax used in our tests: https://raw.githubusercontent.com/mquinson/po4a/master/t/fmt/txt-markdown/NestedLists.md
HTH, Mt
I ran into the same issue while getting started with po4a: https://github.com/EFForg/privacybadger-website/commit/95dc35ebf3e15759dcc0fc560be2d3a81e5c154e
Perhaps both *
and -
should be recognized as valid list markers.
Unordered lists use asterisks, pluses, and hyphens
Thanks @ghostwords. I can confirm that using asterisks instead of hyphens does produce the expected output:
#. type: Plain text
#: bullet_test.md:2
#, markdown-text
msgid "a list"
msgstr ""
#. type: Bullet: '* '
#: bullet_test.md:5
#, markdown-text
msgid "first"
msgstr ""
#. type: Bullet: '* '
#: bullet_test.md:5
#, markdown-text
msgid "second"
msgstr ""
#. type: Bullet: '* '
#: bullet_test.md:5
#, markdown-text
msgid "third"
msgstr ""
I agree (and would consider this a feature request) that both *
and -
be recognized as valid list markers. In my experience, using -
for lists is quite common in markdown. Obviously, using *
in the original md file is a simple work-around, but my use-case here is for translating files that others have written, not myself. I would prefer not to require them to modify their valid markdown.
A related question: does po4a expect (or is scoped to) any particular flavor of markdown?
Ok, I found and fixed the bug, thanks. Lists were only expected in verbatim paragraphs (ie, starting with some spaces, or starting with an asterisk). Btw, our test suite was expecting the buggy behaviour :) The file testing the rules was wrongly parsing leading hyphens as plain paragraphs...
As for the specific flavor of markdown that we use, I confess that I have no idea. The same discussion arised for Asciidoc, and I seem to remember that the conclusion was to be pragmatic and cover as many flavors as possible by default. When flavors stop being compatible, then we need to introduce options to let the user pick their choice.
Thanks @mquinson!
When flavors stop being compatible, then we need to introduce options to let the user pick their choice.
That sounds reasonable to me.
FWIW +
is also a valid list bullet.
I have the following original text file
bullet_test.md
with contents as follows:I generated a PO file with
po4a-updatepo -f text -m bullet_test.md -p bullet_test.po -o markdown
.In the PO file, the list is all on a single line, instead of one line per bullet:
Expected output is each bullet on a separate line.
(It seems like reading the description of Locale::Po4a::Text that this sort of output would be expected with
nobullets
, but I am not using that, nor is that what I want)Any help fixing this would be greatly appreciated. Thanks!
po4a version 0.67 running in docker container
joelnitta/po4a:0.67