From 9eaa1ec4b6a4a3e6c74965bd5ba7a30cbbf0486e Mon Sep 17 00:00:00 2001 From: Nigel Date: Tue, 24 Feb 2026 11:30:29 +0000 Subject: [PATCH] Don't split mid-word in ppcomp output --- src/guiguts/tools/ppcomp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/guiguts/tools/ppcomp.py b/src/guiguts/tools/ppcomp.py index b27cbd57..51712923 100644 --- a/src/guiguts/tools/ppcomp.py +++ b/src/guiguts/tools/ppcomp.py @@ -761,6 +761,10 @@ def replace(match: re.Match) -> str: if not prefix and not suffix: return match.group(0) + # If split between two parts is mid-word, e.g. "C⦕opyright⦖⦓OPYRIGHT⦔", leave unchanged + if re.search(r"\p{Letter}$", a_mid) and re.search(r"^\p{Letter}", b_mid): + return match.group(0) + parts = [] # Prefix stays unmarked parts.append(prefix)