diff --git a/NEWS b/NEWS index 7f712071b..248c5ca54 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,10 @@ Asciidoc: (GitHub's #424). Thanks Jean-Noël Avila for the pull request. * Keep original formating (GitHub's #416). Thanks suddenfall for the feedback, and Jean-Noël Avila for the fixes. + * Fix a bug in handling of bold text starting a list item + (GitHub's #447). Thanks Jean-Noël Avila for the pull request. + * Fix handling of linebreaks in lists (GitHub's #444). Thanks + Jean-Noël Avila for the pull request. Tex: * Allow verbatim environment declaration without trailing space diff --git a/lib/Locale/Po4a/AsciiDoc.pm b/lib/Locale/Po4a/AsciiDoc.pm index 48dda80d2..aada49ad2 100644 --- a/lib/Locale/Po4a/AsciiDoc.pm +++ b/lib/Locale/Po4a/AsciiDoc.pm @@ -919,6 +919,9 @@ sub parse { $paragraph = $text . "\n"; $self->{indent} = ""; $self->{bullet} = $bullet; + } elsif ( not defined $self->{verbatim} + and ( $line eq " +") ) { + $paragraph .= $line . "\n"; } elsif ( ( $line =~ /^\s*$/ ) and ( !defined( $self->{type} ) or ( $self->{type} ne "Table" ) ) ) { # When not in table, empty lines or lines containing only spaces do break paragraphs @@ -1058,7 +1061,7 @@ sub parse { if ( ( $paragraph ne "" && $self->{bullet} && length( $self->{indent} || "" ) == 0 ) ) { - if ( !$self->{options}{'nolinting'} ) { + if ( ( !$self->{options}{'nolinting'} ) && ($paragraph !~ m/ \+\n/ ) ) { # Second line of an item block is not indented. It is unindented # (and allowed) additional text or a new list item. warn wrap_mod( @@ -1080,12 +1083,6 @@ sub parse { $paragraph .= $line . "\n"; } - # paragraphs starting by a bullet, or numbered - # or paragraphs with a line containing many consecutive spaces - # (more than 3) - # are considered as verbatim paragraphs - $wrapped_mode = 0 if ( $paragraph =~ m/^(\*|[0-9]+[.)] )/s - or $paragraph =~ m/[ \t][ \t][ \t]/s ); ( $line, $ref ) = $self->shiftline(); } if ( length $paragraph ) { @@ -1196,7 +1193,7 @@ sub do_paragraph { } @comments = (); - if ( defined $self->{bullet} ) { + if ( ( defined $self->{bullet} ) && !($t =~ /\+\n/ ) ) { my $bullet = $self->{bullet}; my $indent1 = $self->{indent}; my $indent2 = $indent1 . ( ' ' x length($bullet) ); diff --git a/po/pod/it.po b/po/pod/it.po index ca30846c7..41a31f661 100644 --- a/po/pod/it.po +++ b/po/pod/it.po @@ -17,8 +17,8 @@ msgid "" msgstr "" "Project-Id-Version: po4a 0.20\n" "Report-Msgid-Bugs-To: devel@lists.po4a.org\n" -"POT-Creation-Date: 2023-12-30 20:49+0100\n" -"PO-Revision-Date: 2023-08-17 03:01+0200\n" +"POT-Creation-Date: 2023-10-21 17:16+0200\n" +"PO-Revision-Date: 2023-10-21 17:26+0200\n" "Last-Translator: Marco Ciampa \n" "Language-Team: Italian \n" @@ -1562,11 +1562,7 @@ msgid "" "file, you must specify the format parser to use, the location of the " "translated document to produce, and optionally some configuration. File " "names should be quoted or escaped if they contain spaces. Here is an example:" -msgstr "" -"È necessario elencare anche i documenti che devono essere tradotti. Per ogni " -"file master, bisogna specificare l'elaboratore del formato da usare, la " -"posizione del documento tradotto da produrre, e opzionalmente qualche " -"configurazione. Ecco un esempio:" +msgstr "È necessario elencare anche i documenti che devono essere tradotti. Per ogni file master, bisogna specificare l'elaboratore del formato da usare, la posizione del documento tradotto da produrre, e opzionalmente qualche configurazione. Se i nomi dei file dovessero contenere degli spazi, a questi ultimi dovranno essere apposti dei caratteri di escape oppure i nomi interi dovranno essere essere messi tra virgolette. Ecco un esempio:" #. type: verbatim #: po4a:134 @@ -1585,8 +1581,7 @@ msgid "" " de:doc/de/script.xml\n" "\n" msgstr "" -" [type: sgml] doc/my_stuff.sgml fr:doc/fr/mon_truc.sgml \\\n" -" de:doc/de/mein_kram.sgml\n" +" [type: sgml] \"doc/my stuff.sgml\" \"fr:doc/fr/mon truc.sgml\" de:doc/de/mein\\ kram.sgml\n" " [type: man] script fr:doc/fr/script.1 de:doc/de/script.1\n" " [type: docbook] doc/script.xml fr:doc/fr/script.xml \\\n" " de:doc/de/script.xml\n" @@ -2168,10 +2163,8 @@ msgstr "COPYRIGHT E LICENZA" #. type: textblock #: po4a:192 po4a-gettextize:81 po4a-normalize:34 po4a-translate:59 #: po4a-updatepo:58 -#, fuzzy -#| msgid "Copyright 2002-2022 by SPI, inc." msgid "Copyright 2002-2023 by SPI, inc." -msgstr "Copyright 2002-2022 by SPI, inc." +msgstr "Copyright 2002-2023 by SPI, inc." #. type: textblock #: po4a:193 po4a-gettextize:82 po4a-normalize:35 po4a-translate:60 @@ -5096,7 +5089,7 @@ msgid "" "L (markdown, yaml, HTML): a FOSS application " "for online jamming in real time. The website documentation is maintained in " "multiple languages using po4a." -msgstr "" +msgstr "L (markdown, yaml, HTML): un'applicazione FOSS per il jamming online in tempo reale. La documentazione del sito viene mantenuta in più lingue tramite po4a." #. type: textblock #: doc/po4a.7.pod:153 diff --git a/t/fmt/asciidoc/LineBreak.adoc b/t/fmt/asciidoc/LineBreak.adoc index d4dc0c140..e8856ff21 100644 --- a/t/fmt/asciidoc/LineBreak.adoc +++ b/t/fmt/asciidoc/LineBreak.adoc @@ -20,3 +20,18 @@ __________________________ This is a Quote block. + This is a Quote block. __________________________ + +. List item section 1 +. List item section 2 + + + +Another section of list item 2 + +Further text + + +* List item section A +* List item section B + + + +Another section of list item B + +Further text diff --git a/t/fmt/asciidoc/LineBreak.norm b/t/fmt/asciidoc/LineBreak.norm index 8c0c168c6..44b04281e 100644 --- a/t/fmt/asciidoc/LineBreak.norm +++ b/t/fmt/asciidoc/LineBreak.norm @@ -4,9 +4,9 @@ This is a paragraph with a linebreak, where the linebreak occurs on second line The second part of the paragraph is on a second line. * We can do the same with a list item + - After the linebreak, the bullet point is continued. +After the linebreak, the bullet point is continued. * In this bullet point, the list item is continued on the next line. + - Then the line is broken in a second part. +Then the line is broken in a second part. .......................... This is a Literal block. + @@ -17,3 +17,18 @@ __________________________ This is a Quote block. + This is a Quote block. __________________________ + +. List item section 1 +. List item section 2 + + + +Another section of list item 2 + +Further text + + +* List item section A +* List item section B + + + +Another section of list item B + +Further text diff --git a/t/fmt/asciidoc/LineBreak.po b/t/fmt/asciidoc/LineBreak.po index 9d790f6cd..009d79bd8 100644 --- a/t/fmt/asciidoc/LineBreak.po +++ b/t/fmt/asciidoc/LineBreak.po @@ -71,3 +71,42 @@ msgid "" msgstr "" "THIS IS A QUOTE BLOCK.\n" "THIS IS A QUOTE BLOCK." + +#. type: Plain text +#: LineBreak.adoc:25 +msgid "List item section 1" +msgstr "LIST ITEM SECTION 1" + +#. type: Plain text +#: LineBreak.adoc:28 +#, no-wrap +msgid "" +"List item section 2\n" +"\n" +"Another section of list item 2" +msgstr "" +"LIST ITEM SECTION 2\n" +"\n" +"ANOTHER SECTION OF LIST ITEM 2" + +#. type: Plain text +#: LineBreak.adoc:30 LineBreak.adoc:37 +msgid "Further text" +msgstr "FURTHER TEXT" + +#. type: Plain text +#: LineBreak.adoc:33 +msgid "List item section A" +msgstr "LIST ITEM SECTION A" + +#. type: Plain text +#: LineBreak.adoc:36 +#, no-wrap +msgid "" +"List item section B\n" +"\n" +"Another section of list item B" +msgstr "" +"LIST ITEM SECTION B\n" +"\n" +"ANOTHER SECTION OF LIST ITEM B" diff --git a/t/fmt/asciidoc/LineBreak.pot b/t/fmt/asciidoc/LineBreak.pot index 16fc6b59c..144f0c29e 100644 --- a/t/fmt/asciidoc/LineBreak.pot +++ b/t/fmt/asciidoc/LineBreak.pot @@ -62,3 +62,36 @@ msgid "" "This is a Quote block.\n" "This is a Quote block." msgstr "" + +#. type: Plain text +#: LineBreak.adoc:25 +msgid "List item section 1" +msgstr "" + +#. type: Plain text +#: LineBreak.adoc:28 +#, no-wrap +msgid "" +"List item section 2\n" +"\n" +"Another section of list item 2" +msgstr "" + +#. type: Plain text +#: LineBreak.adoc:30 LineBreak.adoc:37 +msgid "Further text" +msgstr "" + +#. type: Plain text +#: LineBreak.adoc:33 +msgid "List item section A" +msgstr "" + +#. type: Plain text +#: LineBreak.adoc:36 +#, no-wrap +msgid "" +"List item section B\n" +"\n" +"Another section of list item B" +msgstr "" diff --git a/t/fmt/asciidoc/LineBreak.trans b/t/fmt/asciidoc/LineBreak.trans index aa0608ca8..b4bab2403 100644 --- a/t/fmt/asciidoc/LineBreak.trans +++ b/t/fmt/asciidoc/LineBreak.trans @@ -4,9 +4,9 @@ THIS IS A PARAGRAPH WITH A LINEBREAK, WHERE THE LINEBREAK OCCURS ON SECOND LINE THE SECOND PART OF THE PARAGRAPH IS ON A SECOND LINE. * WE CAN DO THE SAME WITH A LIST ITEM + - AFTER THE LINEBREAK, THE BULLET POINT IS CONTINUED. +AFTER THE LINEBREAK, THE BULLET POINT IS CONTINUED. * IN THIS BULLET POINT, THE LIST ITEM IS CONTINUED ON THE NEXT LINE. + - THEN THE LINE IS BROKEN IN A SECOND PART. +THEN THE LINE IS BROKEN IN A SECOND PART. .......................... THIS IS A LITERAL BLOCK. + @@ -17,3 +17,18 @@ __________________________ THIS IS A QUOTE BLOCK. + THIS IS A QUOTE BLOCK. __________________________ + +. LIST ITEM SECTION 1 +. LIST ITEM SECTION 2 + + + +ANOTHER SECTION OF LIST ITEM 2 + +FURTHER TEXT + + +* LIST ITEM SECTION A +* LIST ITEM SECTION B + + + +ANOTHER SECTION OF LIST ITEM B + +FURTHER TEXT diff --git a/t/fmt/asciidoc/Lists.adoc b/t/fmt/asciidoc/Lists.adoc index 22f38c61a..bc5fb3de3 100644 --- a/t/fmt/asciidoc/Lists.adoc +++ b/t/fmt/asciidoc/Lists.adoc @@ -247,3 +247,6 @@ After deciding the fate for all hunks, if there is any hunk that was chosen, the * [x] Checked * [X] Checked * [*] Checked + +1. *starting* with + a strong item diff --git a/t/fmt/asciidoc/Lists.norm b/t/fmt/asciidoc/Lists.norm index de9f157ec..5b09f2030 100644 --- a/t/fmt/asciidoc/Lists.norm +++ b/t/fmt/asciidoc/Lists.norm @@ -226,3 +226,5 @@ After deciding the fate for all hunks, if there is any hunk that was chosen, the * [x] Checked * [X] Checked * [*] Checked + +1. *starting* with a strong item diff --git a/t/fmt/asciidoc/Lists.po b/t/fmt/asciidoc/Lists.po index 3d0ad9475..a649e5de1 100644 --- a/t/fmt/asciidoc/Lists.po +++ b/t/fmt/asciidoc/Lists.po @@ -659,6 +659,11 @@ msgid "Unchecked" msgstr "UNCHECKED" #. type: Plain text -#: Lists.adoc:248 Lists.adoc:249 +#: Lists.adoc:248 Lists.adoc:249 Lists.adoc:250 msgid "Checked" msgstr "CHECKED" + +#. type: Plain text +#: Lists.adoc:252 +msgid "*starting* with a strong item" +msgstr "*STARTING* WITH A STRONG ITEM" diff --git a/t/fmt/asciidoc/Lists.pot b/t/fmt/asciidoc/Lists.pot index ff2fbfb11..025bbd4f6 100644 --- a/t/fmt/asciidoc/Lists.pot +++ b/t/fmt/asciidoc/Lists.pot @@ -614,6 +614,11 @@ msgid "Unchecked" msgstr "" #. type: Plain text -#: Lists.adoc:248 Lists.adoc:249 +#: Lists.adoc:248 Lists.adoc:249 Lists.adoc:250 msgid "Checked" msgstr "" + +#. type: Plain text +#: Lists.adoc:252 +msgid "*starting* with a strong item" +msgstr "" diff --git a/t/fmt/asciidoc/Lists.trans b/t/fmt/asciidoc/Lists.trans index 85ebac69b..35ccfb141 100644 --- a/t/fmt/asciidoc/Lists.trans +++ b/t/fmt/asciidoc/Lists.trans @@ -226,3 +226,5 @@ AFTER DECIDING THE FATE FOR ALL HUNKS, IF THERE IS ANY HUNK THAT WAS CHOSEN, THE * [x] CHECKED * [X] CHECKED * [*] CHECKED + +1. *STARTING* WITH A STRONG ITEM diff --git a/t/fmt/asciidoc/Paragraphs.adoc b/t/fmt/asciidoc/Paragraphs.adoc index 7cbd52c0e..17153705c 100644 --- a/t/fmt/asciidoc/Paragraphs.adoc +++ b/t/fmt/asciidoc/Paragraphs.adoc @@ -59,3 +59,11 @@ If --stdin was also used then this is prefixed by either "pack\t", or "keep\t" i new .keep file was successfully created. This is useful to remove a .keep file used as a lock to prevent the race with 'git repack' mentioned above. + +TIP: we're starting a +multi-line +Tip box. + +TIP: *now bold* +text in +the beginning diff --git a/t/fmt/asciidoc/Paragraphs.norm b/t/fmt/asciidoc/Paragraphs.norm index 60fe4906c..af9bf15ec 100644 --- a/t/fmt/asciidoc/Paragraphs.norm +++ b/t/fmt/asciidoc/Paragraphs.norm @@ -55,3 +55,7 @@ NOTE: This is my special note. NOTE: What lovely war. If --stdin was also used then this is prefixed by either "pack\t", or "keep\t" if a new .keep file was successfully created. This is useful to remove a .keep file used as a lock to prevent the race with 'git repack' mentioned above. + +TIP: we're starting a multi-line Tip box. + +TIP: *now bold* text in the beginning diff --git a/t/fmt/asciidoc/Paragraphs.po b/t/fmt/asciidoc/Paragraphs.po index b9091a48f..b26d7d231 100644 --- a/t/fmt/asciidoc/Paragraphs.po +++ b/t/fmt/asciidoc/Paragraphs.po @@ -125,6 +125,16 @@ msgid "What lovely war." msgstr "WHAT LOVELY WAR." #. type: Plain text -#: Paragraphs.adoc:61 +#: Paragraphs.adoc:62 msgid "If --stdin was also used then this is prefixed by either \"pack\\t\", or \"keep\\t\" if a new .keep file was successfully created. This is useful to remove a .keep file used as a lock to prevent the race with 'git repack' mentioned above." msgstr "IF --STDIN WAS ALSO USED THEN THIS IS PREFIXED BY EITHER \"PACK\\T\", OR \"KEEP\\T\" IF A NEW .KEEP FILE WAS SUCCESSFULLY CREATED. THIS IS USEFUL TO REMOVE A .KEEP FILE USED AS A LOCK TO PREVENT THE RACE WITH 'GIT REPACK' MENTIONED ABOVE." + +#. type: Plain text +#: Paragraphs.adoc:66 +msgid "we're starting a multi-line Tip box." +msgstr "WE'RE STARTING A MULTI-LINE TIP BOX." + +#. type: Plain text +#: Paragraphs.adoc:69 +msgid "*now bold* text in the beginning" +msgstr "*NOW BOLD* TEXT IN THE BEGINNING" diff --git a/t/fmt/asciidoc/Paragraphs.pot b/t/fmt/asciidoc/Paragraphs.pot index ec86c5809..cbc8d5fa8 100644 --- a/t/fmt/asciidoc/Paragraphs.pot +++ b/t/fmt/asciidoc/Paragraphs.pot @@ -115,10 +115,20 @@ msgid "What lovely war." msgstr "" #. type: Plain text -#: Paragraphs.adoc:61 +#: Paragraphs.adoc:62 msgid "" "If --stdin was also used then this is prefixed by either \"pack\\t\", or " "\"keep\\t\" if a new .keep file was successfully created. This is useful to " "remove a .keep file used as a lock to prevent the race with 'git repack' " "mentioned above." msgstr "" + +#. type: Plain text +#: Paragraphs.adoc:66 +msgid "we're starting a multi-line Tip box." +msgstr "" + +#. type: Plain text +#: Paragraphs.adoc:69 +msgid "*now bold* text in the beginning" +msgstr "" diff --git a/t/fmt/asciidoc/Paragraphs.trans b/t/fmt/asciidoc/Paragraphs.trans index 0b07a9e35..56b646fe9 100644 --- a/t/fmt/asciidoc/Paragraphs.trans +++ b/t/fmt/asciidoc/Paragraphs.trans @@ -55,3 +55,7 @@ NOTE: THIS IS MY SPECIAL NOTE. NOTE: WHAT LOVELY WAR. IF --STDIN WAS ALSO USED THEN THIS IS PREFIXED BY EITHER "PACK\T", OR "KEEP\T" IF A NEW .KEEP FILE WAS SUCCESSFULLY CREATED. THIS IS USEFUL TO REMOVE A .KEEP FILE USED AS A LOCK TO PREVENT THE RACE WITH 'GIT REPACK' MENTIONED ABOVE. + +TIP: WE'RE STARTING A MULTI-LINE TIP BOX. + +TIP: *NOW BOLD* TEXT IN THE BEGINNING