Skip to content

Commit 754e994

Browse files
committed
Comment formatting
1 parent 68b6982 commit 754e994

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

se/se_epub_lint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ def _lint_xhtml_syntax_checks(self, filename: Path, dom: se.easy_xml.EasyXmlTree
17721772
# dump(section, "")
17731773
# exit()
17741774

1775-
# Check for numeric entities
1775+
# Check for numeric entities.
17761776
matches = regex.findall(r"&#[0-9]+?;", file_contents)
17771777
if matches:
17781778
messages.append(LintMessage("s-001", "Illegal numeric entity (like [xhtml]Α[/]).", se.MESSAGE_TYPE_ERROR, filename, natsorted(list(set(matches)))))
@@ -1798,9 +1798,9 @@ def _lint_xhtml_syntax_checks(self, filename: Path, dom: se.easy_xml.EasyXmlTree
17981798

17991799
messages.append(LintMessage("s-006", "Poem or verse [xhtml]<p>[/] (stanza) without [xhtml]<span>[/] (line) element.", se.MESSAGE_TYPE_WARNING, filename, matches))
18001800

1801-
# Check for elements that don't have a direct block child
1802-
# Allow white space and comments before the first child
1803-
# Ignore children of the ToC and landmarks as they do not require p children
1801+
# Check for elements that don't have a direct block child.
1802+
# Allow white space and comments before the first child.
1803+
# Ignore children of the ToC and landmarks as they do not require `<p>` children.
18041804
nodes = dom.xpath("/html/body//*[(name()='blockquote' or name()='dd' or name()='header' or name()='li' or name()='footer') and not(./ancestor::*[contains(@epub:type, 'toc') or contains(@epub:type, 'landmarks')]) and (node()[normalize-space(.) and not(self::comment())])[1][not(name()='p' or name()='blockquote' or name()='div' or name()='table' or name()='header' or name()='ul' or name()='ol' or name() = 'section' or name()='footer' or name()='hgroup' or re:test(name(), '^h[0-6]'))]]")
18051805
if nodes:
18061806
messages.append(LintMessage("s-007", "Element requires at least one block-level child.", se.MESSAGE_TYPE_WARNING, filename, [node.to_string() for node in nodes]))

0 commit comments

Comments
 (0)