[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/ParagraphNonXS.pm (add_text)
From: |
Gavin D. Smith |
Subject: |
branch master updated: * tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): Simplify regexp by taking \x{202f} and \x{00a0} out, as these are not matched with \s with the /a flag. |
Date: |
Mon, 17 Jan 2022 14:33:18 -0500 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new d691efbbd2 * tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): Simplify
regexp by taking \x{202f} and \x{00a0} out, as these are not matched with \s
with the /a flag.
d691efbbd2 is described below
commit d691efbbd278ef08d2e7616e0e2585d5a08b99ef
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Jan 17 19:33:05 2022 +0000
* tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): Simplify regexp
by taking \x{202f} and \x{00a0} out, as these are not matched with
\s with the /a flag.
---
ChangeLog | 6 ++++++
tp/Texinfo/Convert/ParagraphNonXS.pm | 6 +++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5bf95fa07a..562ec3da46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-01-17 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): Simplify regexp
+ by taking \x{202f} and \x{00a0} out, as these are not matched with
+ \s with the /a flag.
+
2022-01-16 Patrice Dumas <pertusus@free.fr>
* Pod-Simple-Texinfo/prove.sh: -I ../tp for Texinfo::ModulePath in
builddir
diff --git a/tp/Texinfo/Convert/ParagraphNonXS.pm
b/tp/Texinfo/Convert/ParagraphNonXS.pm
index 9dc25bf6cb..ad600c5f91 100644
--- a/tp/Texinfo/Convert/ParagraphNonXS.pm
+++ b/tp/Texinfo/Convert/ParagraphNonXS.pm
@@ -1,6 +1,6 @@
# ParagraphNonXS.pm: handle paragraph text.
#
-# Copyright 2010-2019 Free Software Foundation, Inc.
+# Copyright 2010-2022 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -311,8 +311,9 @@ 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}])+)/a,
+ /(\s+)|(\p{InFullwidth})|((?:[^\s\p{InFullwidth}])+)/a,
$text;
+ # the /a flag limits the \s to ASCII spaces
# Check now if a newline exists anywhere in the string to
# try to eliminate regex checks later.
@@ -332,7 +333,6 @@ sub add_text($$)
._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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): Simplify regexp by taking \x{202f} and \x{00a0} out, as these are not matched with \s with the /a flag.,
Gavin D. Smith <=