From 95600fc36ceddf2ec2bc1ba0e6ac2ed0d5ce8e57 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 17 Feb 2025 20:17:56 -0600 Subject: [PATCH] lint: Improve t-029 --- se/se_epub_lint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/se/se_epub_lint.py b/se/se_epub_lint.py index 58ea85de..b4a64bcd 100644 --- a/se/se_epub_lint.py +++ b/se/se_epub_lint.py @@ -2526,7 +2526,8 @@ def _lint_xhtml_typography_checks(filename: Path, dom: se.easy_xml.EasyXmlTree, temp_xhtml = regex.sub(r"]*?>.+?", "", file_contents) # Remove because it might contain something like <title>Chapter 2: The Antechamber of M. de Tréville temp_xhtml = regex.sub(r"]*?>", "", temp_xhtml) # Replace things like temp_xhtml = regex.sub(r"]*?>", "", temp_xhtml) # Remove attributes - temp_xhtml = temp_xhtml.replace("A.B.C.", "X") # Remove A.B.C, which is not an abbreviations. + temp_xhtml = temp_xhtml.replace("A.B.C.", "X") # Remove A.B.C, which is not an abbreviation. + temp_xhtml = temp_xhtml.replace("X.Y.Z.", "X") # Remove X.Y.Z., which is usually used in the same sense as `A.B.C.` and is also not an abbreviation. # Note the regex also excludes preceding numbers, so that we can have inline numbering like: # "A number of questions: 1. regarding those who make heretics; 2. concerning those who were made heretics..." matches = regex.findall(r"[^\s0-9]+\.\s+[\p{Lowercase_Letter}](?!’[\p{Uppercase_Letter}])[\p{Lowercase_Letter}]+", temp_xhtml)