[Po4a-devel] asciidoc table support

D. Barbier bouzim at gmail.com
Mon Sep 10 17:10:30 UTC 2012


On 2012/9/10 Anders Nawroth wrote:
> Hi!
>
> I just found out about po4a recently, and it matches my use case very
> well which is wonderful!
>
> Anyhow, I'm having a problem with the AsciiDoc support.
> It seems it simply doesn't parse table differently (marking them as Plain text).
> Which of course ruins the markup completely (as it's rewrapped).
>
> I tried fixing this by editing the Text.pm file, matching the table
> markup in line 376
> (of the current trunk version of the file), like so:
>  ($line =~ m/^(\/{4,}|\+{4,}|-{4,}|\.{4,}|\*{4,}|_{4,}|={4,}|~{4,}|\|(=){4,})$/))
> {
> i.e., adding |\|(=){4,}
> and then modifying the listing block code to make it handle tables as
> well (line 398):
>  } elsif ($t eq "-" || $t eq "|") {
>
> This makes po4a-gettextize output a po file that looks perfect to me.
> The content of the table is recognized as a delimited block, set to no-wrap,
> and the text has explicit \n's for the newlines.
>
> The problem comes when running po4a-translate.
> The table markup is still rewrapped in the result!
>
> Can anybody give me a hint as to what I'm missing here?
>
> I attached example data in a file.

Hello Anders,

Your patch looks good and works for me, thus I committed it into SVN
to make sure that we use the same files.  If you still have trouble,
can you please post a minimal testcase to reproduce it?  Maybe your
real example triggers some bug which does not occur when using only an
excerpt.

Denis



More information about the Po4a-devel mailing list