Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asciidoc: process xlabel of id #402

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/Locale/Po4a/AsciiDoc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion t/fmt/asciidoc/BlockId.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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>>.
2 changes: 1 addition & 1 deletion t/fmt/asciidoc/BlockId.norm
Original file line number Diff line number Diff line change
Expand Up @@ -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>>.
6 changes: 6 additions & 0 deletions t/fmt/asciidoc/BlockId.po
Original file line number Diff line number Diff line change
Expand Up @@ -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>>."
Expand Down
6 changes: 6 additions & 0 deletions t/fmt/asciidoc/BlockId.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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>>."
Expand Down
2 changes: 1 addition & 1 deletion t/fmt/asciidoc/BlockId.trans
Original file line number Diff line number Diff line change
Expand Up @@ -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>>.