[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: ASCII spaces only
From: |
Gavin D. Smith |
Subject: |
branch master updated: ASCII spaces only |
Date: |
Mon, 17 Jan 2022 15:14:31 -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 02cc29ac51 ASCII spaces only
02cc29ac51 is described below
commit 02cc29ac514d0b47066897a6e01781b03c709e60
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Jan 17 20:14:19 2022 +0000
ASCII spaces only
* tp/Texinfo/XS/xspara.c (xspara_add_text): Call isspace instead
of iswspace to match change in ParagraphNonXS.pm.
* tp/Texinfo/Convert/Plaintext.pm (_protect_sentence_ends):
Remove special handling of \x{202f} and \x{00a0}, using \a flag
instead.
---
ChangeLog | 10 ++++++++++
tp/Texinfo/Convert/Plaintext.pm | 10 ++++------
tp/Texinfo/XS/xspara.c | 4 ++--
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 562ec3da46..37812d3144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-01-17 Gavin Smith <gavinsmith0123@gmail.com>
+
+ ASCII spaces only
+
+ * tp/Texinfo/XS/xspara.c (xspara_add_text): Call isspace instead
+ of iswspace to match change in ParagraphNonXS.pm.
+ * tp/Texinfo/Convert/Plaintext.pm (_protect_sentence_ends):
+ Remove special handling of \x{202f} and \x{00a0}, using \a flag
+ instead.
+
2022-01-17 Gavin Smith <gavinsmith0123@gmail.com>
* tp/Texinfo/Convert/ParagraphNonXS.pm (add_text): Simplify regexp
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 2e2d41243e..ab56d25e32 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -542,20 +542,18 @@ sub _protect_sentence_ends ($) {
my $text = shift;
# Avoid suppressing end of sentence, by inserting a control character
# in front of the full stop. The choice of BS for this is arbitrary.
- $text =~ s/(?<=[^[:upper:]])
+ $text =~ s/(?<=[^\p{Upper}])
(?=[$end_sentence][$after_punctuation]*(?:\s|$))
- /\x08/gx;
+ /\x08/xag;
# Also insert a control character at end of string, to protect a full stop
# that may follow later.
- #$text =~ s/(?<=[^[:upper:]][$after_punctuation]*)$/\x08/;
+ #$text =~ s/(?<=[^\p{Upper}\s][$after_punctuation]*)$/\x08/a;
# Perl doesn't support "variable length lookbehind"
$text = reverse $text;
- $text =~ s/^(?=[$after_punctuation]*
- (?:[^[:upper:]\s]|[\x{202f}\x{00a0}]))
- /\x08/x;
+ $text =~ s/^(?=[$after_punctuation]*(?:[^\p{Upper}\s]))/\x08/xa;
$text = reverse $text;
return $text;
diff --git a/tp/Texinfo/XS/xspara.c b/tp/Texinfo/XS/xspara.c
index 83c76fba48..4664c6b50a 100644
--- a/tp/Texinfo/XS/xspara.c
+++ b/tp/Texinfo/XS/xspara.c
@@ -185,6 +185,7 @@ mbrtowc (wchar_t * __restrict__ pwc, const char *
__restrict__ mbs, size_t n,
}
}
+/* NOTE - not used at present */
int
iswspace (wint_t wc)
{
@@ -866,8 +867,7 @@ xspara_add_text (char *text)
continue;
}
- /* 00A0 and 202F are non-breaking spaces in Unicode. */
- if (iswspace (wc) && wc != L'\x00a0' && wc != L'\x202f')
+ if (isspace (*p))
{
state.last_letter = L'\0';
- branch master updated: ASCII spaces only,
Gavin D. Smith <=