Skip to content

Commit

Permalink
Include matched numeric entities in s-001 lint message
Browse files Browse the repository at this point in the history
  • Loading branch information
apasel422 authored and acabal committed Jun 22, 2024
1 parent 9c75efe commit dfb92d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion se/se_epub_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ def _lint_xhtml_syntax_checks(self, filename: Path, dom: se.easy_xml.EasyXmlTree
# Check for numeric entities
matches = regex.findall(r"&#[0-9]+?;", file_contents)
if matches:
messages.append(LintMessage("s-001", "Illegal numeric entity (like [xhtml]Α[/]).", se.MESSAGE_TYPE_ERROR, filename))
messages.append(LintMessage("s-001", "Illegal numeric entity (like [xhtml]Α[/]).", se.MESSAGE_TYPE_ERROR, filename, natsorted(list(set(matches)))))

# Check nested <blockquote> elements, but only if it's the first child of another <blockquote>
nodes = dom.xpath("/html/body//blockquote/*[1][name()='blockquote']")
Expand Down
3 changes: 3 additions & 0 deletions tests/lint/semantic/s-001/golden/s-001-out.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
s-001 [Error] chapter-1.xhtml Illegal numeric entity (like `&#913;`).
&#913;
&#914;
&#915;

0 comments on commit dfb92d0

Please sign in to comment.