From 6afc4cdb3135797f2f99c298b96793a5e64b63db Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Fri, 10 May 2024 16:38:00 -0500 Subject: [PATCH] lint: Fix but in t-075 --- 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 40407b55..28a1abdb 100644 --- a/se/se_epub_lint.py +++ b/se/se_epub_lint.py @@ -2750,7 +2750,8 @@ def _lint_xhtml_typography_checks(filename: Path, dom: se.easy_xml.EasyXmlTree, messages.append(LintMessage("t-074", "Extended sound using hyphen-minus [text]-[/] instead of non-breaking hyphen [text]‑[/].", se.MESSAGE_TYPE_WARNING, filename, [node.to_string() for node in nodes])) # Check if we have a word accented with an acute accent instead of a grave accent in verse scansion. - nodes = dom.xpath("/html/body//*[not(@xml:lang) and re:test(@epub:type, 'z3998:(poem|verse|hymn|song)')]//span[not(ancestor-or-self::*[not(name() = 'html') and @xml:lang]) and not(./span) and re:test(., '[A-Za-z][áéíóú][A-za-z]')]") + dom_copy = deepcopy(dom) + nodes = dom_copy.xpath("/html/body//*[not(@xml:lang) and re:test(@epub:type, 'z3998:(poem|verse|hymn|song)')]//span[not(ancestor-or-self::*[not(name() = 'html') and @xml:lang]) and not(./span) and re:test(., '[A-Za-z][áéíóú][A-za-z]')]") filtered_nodes = [] if nodes: