[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 16 Jan 2022 13:28:58 -0500 (EST) |
branch: master
commit 4f000b63f61e18c900ffba4377457d7aa2b7f6d9
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 16 19:28:45 2022 +0100
Use /a regexp modifier in NonXS paragraph handling for Info
* tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): use /a modifier
to consider non ascii space as characters.
---
ChangeLog | 7 +++++++
tp/Texinfo/Convert/ParagraphNonXS.pm | 8 +++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7636843f1b..4d21e4086d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-01-16 Patrice Dumas <pertusus@free.fr>
+
+ Use /a regexp modifier in NonXS paragraph handling for Info
+
+ * tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): use /a modifier
+ to consider non ascii space as characters.
+
2022-01-16 Patrice Dumas <pertusus@free.fr>
Use /a regexp modifier to consider only ascii spaces in matching
diff --git a/tp/Texinfo/Convert/ParagraphNonXS.pm
b/tp/Texinfo/Convert/ParagraphNonXS.pm
index e26b18a771..9dc25bf6cb 100644
--- a/tp/Texinfo/Convert/ParagraphNonXS.pm
+++ b/tp/Texinfo/Convert/ParagraphNonXS.pm
@@ -311,7 +311,7 @@ sub add_text($$)
my $protect_spaces_flag = $paragraph->{'protect_spaces'};
my @segments = split
-/([^\S\x{202f}\x{00a0}]+)|(\p{InFullwidth})|((?:[^\s\p{InFullwidth}]|[\x{202f}\x{00a0}])+)/,
+/([^\S\x{202f}\x{00a0}]+)|(\p{InFullwidth})|((?:[^\s\p{InFullwidth}]|[\x{202f}\x{00a0}])+)/a,
$text;
# Check now if a newline exists anywhere in the string to
@@ -328,12 +328,14 @@ sub add_text($$)
if ($debug_flag) {
my $word = 'UNDEF';
$word = $paragraph->{'word'} if (defined($paragraph->{'word'}));
- print STDERR "p ($paragraph->{'counter'}+$paragraph->{'word_counter'}) s
`"._print_escaped_spaces($paragraph->{'space'})."', w `$word'\n";
+ print STDERR "p ($paragraph->{'counter'}+$paragraph->{'word_counter'}) s
`"
+ ._print_escaped_spaces($paragraph->{'space'})."', w `$word'\n";
#print STDERR "TEXT: "._print_escaped_spaces($text)."|\n"
}
# \x{202f}\x{00a0} are non breaking spaces
if (defined $spaces) {
- print STDERR "SPACES($paragraph->{'counter'})
`"._print_escaped_spaces($spaces)."'\n" if $debug_flag;
+ print STDERR "SPACES($paragraph->{'counter'}) `"
+ ._print_escaped_spaces($spaces)."'\n" if $debug_flag;
if ($protect_spaces_flag) {
$paragraph->{'word'} .= $spaces;
$paragraph->{'last_char'} = substr($spaces, -1);