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: Don't split in attributes include:: and ifeval:: lines #298

Merged
merged 1 commit into from
Mar 13, 2021
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
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __ __/ _ \ / /_ | || |

Asciidoc:
* Detect sublevel description lists with :::
* Don't split in attributes include:: and ifeval:: lines

Translations:
Status of the binary translation:
Expand Down
4 changes: 4 additions & 0 deletions lib/Locale/Po4a/AsciiDoc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,10 @@ sub parse {
and ( defined( $self->{type} ) and ( $self->{type} eq "Table" ) ) )
{
$paragraph .= $line . "\n";
} elsif ( ( $macroname eq "include" || $macroname eq "ifeval" )
and ( $macrotype eq '::' ) )
{
$self->pushline( $line . "\n" );
} else {
if ( $macrotype eq '::' ) {
do_paragraph( $self, $paragraph, $wrapped_mode );
Expand Down
4 changes: 4 additions & 0 deletions t/fmt/asciidoc/StyleMacro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ image::foo.png[]
ifeval::[42 == 42]
// Empty macro target:
endif::[]

ifeval::["{foo}" == "bar"]
include::{foo-path}bar.adoc[leveloffset=+1, lines=7..21;32..-1]
endif::[]
4 changes: 4 additions & 0 deletions t/fmt/asciidoc/StyleMacro.norm
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ image::foo.png[]

ifeval::[42 == 42]
endif::[]

ifeval::["{foo}" == "bar"]
include::{foo-path}bar.adoc[leveloffset=+1, lines=7..21;32..-1]
endif::[]
2 changes: 1 addition & 1 deletion t/fmt/asciidoc/StyleMacro.pot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2020-04-28 11:26+0200\n"
"POT-Creation-Date: 2021-03-13 16:59-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
4 changes: 4 additions & 0 deletions t/fmt/asciidoc/StyleMacro.trans
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ image::FOO.PNG[]

ifeval::[42 == 42]
endif::[]

ifeval::["{foo}" == "bar"]
include::{foo-path}bar.adoc[leveloffset=+1, lines=7..21;32..-1]
endif::[]