Skip to content

Commit

Permalink
Merge pull request #298 from dbaio/master
Browse files Browse the repository at this point in the history
Asciidoc: Don't split in attributes include:: and ifeval:: lines
  • Loading branch information
mquinson committed Mar 13, 2021
2 parents 809a46b + 9d8f901 commit f931cd0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
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::[]

0 comments on commit f931cd0

Please sign in to comment.