diff --git a/lib/Locale/Po4a/AsciiDoc.pm b/lib/Locale/Po4a/AsciiDoc.pm index e7c8bde56..8523f8b67 100644 --- a/lib/Locale/Po4a/AsciiDoc.pm +++ b/lib/Locale/Po4a/AsciiDoc.pm @@ -687,9 +687,19 @@ sub parse { { # Found BlockId do_paragraph( $self, $paragraph, $wrapped_mode ); - $paragraph = ""; + my $block_id = $1; + $paragraph = ""; $wrapped_mode = 1; - $self->pushline( $line . "\n" ); + if ($block_id =~ m/^([^,]+),(.+)$/) { + # Found BlockId with a xlabel + my $xlabel = $2; + $block_id = $1; + $self->pushline( "[[$block_id," ); + do_paragraph( $self, $xlabel, 0); + $self->pushline( "]]\n" ); + } else { + $self->pushline( $line . "\n" ); + } undef $self->{bullet}; undef $self->{indent}; } elsif ( not defined $self->{verbatim} diff --git a/t/fmt/asciidoc/BlockId.adoc b/t/fmt/asciidoc/BlockId.adoc index e702300b0..12f895ab3 100644 --- a/t/fmt/asciidoc/BlockId.adoc +++ b/t/fmt/asciidoc/BlockId.adoc @@ -5,5 +5,5 @@ Test BlockId Element Some paragraph text. Some paragraph text. Some paragraph text. Some paragraph text. Some paragraph text. Some paragraph text. - +[[ipsum-quia,Second Paragraph]] Reference to <<lorem-ipsum, Lorem Ipsum>>. diff --git a/t/fmt/asciidoc/BlockId.norm b/t/fmt/asciidoc/BlockId.norm index bbcc10c3d..f31386be5 100644 --- a/t/fmt/asciidoc/BlockId.norm +++ b/t/fmt/asciidoc/BlockId.norm @@ -4,5 +4,5 @@ Test BlockId Element [[lorem-ipsum]] Some paragraph text. Some paragraph text. Some paragraph text. Some paragraph text. Some paragraph text. Some paragraph text. - +[[ipsum-quia,Second Paragraph]] Reference to <<lorem-ipsum, Lorem Ipsum>>. diff --git a/t/fmt/asciidoc/BlockId.po b/t/fmt/asciidoc/BlockId.po index 0afe5ab2a..037340f32 100644 --- a/t/fmt/asciidoc/BlockId.po +++ b/t/fmt/asciidoc/BlockId.po @@ -31,6 +31,12 @@ msgstr "" "SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT. SOME " "PARAGRAPH TEXT. SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT." +#. type: Plain text +#: BlockId.adoc:8 +#, no-wrap +msgid "Second Paragraph" +msgstr "SECOND PARAGRAPH" + #. type: Plain text #: BlockId.adoc:9 msgid "Reference to <<lorem-ipsum, Lorem Ipsum>>." diff --git a/t/fmt/asciidoc/BlockId.pot b/t/fmt/asciidoc/BlockId.pot index 8f11a8be3..696db444e 100644 --- a/t/fmt/asciidoc/BlockId.pot +++ b/t/fmt/asciidoc/BlockId.pot @@ -29,6 +29,12 @@ msgid "" "paragraph text. Some paragraph text. Some paragraph text." msgstr "" +#. type: Plain text +#: BlockId.adoc:8 +#, no-wrap +msgid "Second Paragraph" +msgstr "" + #. type: Plain text #: BlockId.adoc:9 msgid "Reference to <<lorem-ipsum, Lorem Ipsum>>." diff --git a/t/fmt/asciidoc/BlockId.trans b/t/fmt/asciidoc/BlockId.trans index 51b2e7c08..3624d5e3d 100644 --- a/t/fmt/asciidoc/BlockId.trans +++ b/t/fmt/asciidoc/BlockId.trans @@ -4,5 +4,5 @@ TEST BLOCKID ELEMENT [[lorem-ipsum]] SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT. SOME PARAGRAPH TEXT. - +[[ipsum-quia,SECOND PARAGRAPH]] REFERENCE TO <<lorem-ipsum, LOREM IPSUM>>.