From 3d62d113ea69cde2dab11d8ca9987a3d2dfbaf46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Date: Sat, 16 Dec 2023 21:18:56 +0100 Subject: [PATCH] Remove bogus processing of paragraphs starting with star This fixes #447. --- lib/Locale/Po4a/AsciiDoc.pm | 6 ------ t/fmt/asciidoc/Lists.adoc | 3 +++ t/fmt/asciidoc/Lists.norm | 2 ++ t/fmt/asciidoc/Lists.po | 7 ++++++- t/fmt/asciidoc/Lists.pot | 7 ++++++- t/fmt/asciidoc/Lists.trans | 2 ++ t/fmt/asciidoc/Paragraphs.adoc | 8 ++++++++ t/fmt/asciidoc/Paragraphs.norm | 4 ++++ t/fmt/asciidoc/Paragraphs.po | 12 +++++++++++- t/fmt/asciidoc/Paragraphs.pot | 12 +++++++++++- t/fmt/asciidoc/Paragraphs.trans | 4 ++++ 11 files changed, 57 insertions(+), 10 deletions(-) diff --git a/lib/Locale/Po4a/AsciiDoc.pm b/lib/Locale/Po4a/AsciiDoc.pm index 48dda80d2..e2c770d85 100644 --- a/lib/Locale/Po4a/AsciiDoc.pm +++ b/lib/Locale/Po4a/AsciiDoc.pm @@ -1080,12 +1080,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 ) { 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