mquinson / po4a

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

Markdown tables not parsed properly #496

Closed NightTsarina closed 4 months ago

NightTsarina commented 5 months ago

Hi,

Today I noticed that po4a is breaking tables created using the GitHub MarkDown format:

$ cat foo.md 
| Head 1 | Head 2 |
| ------ | ------ |
| Cell 1 | Cell 2 |

$ po4a-updatepo --no-deprecation -M UTF-8 -f text -o markdown --wrap-po=newlines -m foo.md -p foo.pot

$ tail -n5 foo.pot 
#. type: Plain text
#: foo.md:3
#, markdown-text
msgid "| Head 1 | Head 2 | | ------ | ------ | | Cell 1 | Cell 2 |"
msgstr ""

$ po4a-translate --no-deprecation -M UTF-8 -f text -o markdown -k 0 -m foo.md -p foo.pot -l foo_translated.md

$ cat foo_translated.md 
| Head 1 | Head 2 | | ------ | ------ | | Cell 1 | Cell 2 |

I understand this is not part of the base MD spec, and that it might be difficult to support, but I can't even find a way to tell po4a to not re-flow the block