From 41c196044c58e6641b2c9676af41658162e7c059 Mon Sep 17 00:00:00 2001 From: Robin Whittleton Date: Mon, 11 May 2026 21:50:01 +0200 Subject: [PATCH] =?UTF-8?q?semanticate:=20don=E2=80=99t=20add=20initialism?= =?UTF-8?q?=20to=20compass=20semantics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- se/formatting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/se/formatting.py b/se/formatting.py index 0705b5a0..ab73deb4 100644 --- a/se/formatting.py +++ b/se/formatting.py @@ -219,7 +219,7 @@ def semanticate(xhtml: str) -> str: node.set_attr("role", "presentation") # Add some semantics to abbreviations. - for node in dom.xpath("/html/body//abbr[(re:test(., '^([A-Z]\\.)+') or re:test(., '^AD|BC$')) and not(re:test(@epub:type, 'z3998:(initialism|given-name)'))]"): + for node in dom.xpath("/html/body//abbr[(re:test(., '^([A-Z]\\.)+') or re:test(., '^AD|BC$')) and not(re:test(@epub:type, 'z3998:(initialism|given-name)|se:compass'))]"): node.add_attr_value("epub:type", "z3998:initialism") for node in dom.xpath("/html/body//abbr[re:test(., '^[A-Z]+$') and not(re:test(@epub:type, 'z3998:(acronym|initialism)|se:era'))]"):