Skip to content

Commit

Permalink
lint: Fix but in t-075
Browse files Browse the repository at this point in the history
  • Loading branch information
acabal committed May 10, 2024
1 parent a733796 commit 6afc4cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion se/se_epub_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6afc4cd

Please sign in to comment.