Skip to content

Commit

Permalink
lint: Add t-077, punctuation followed by opening quote
Browse files Browse the repository at this point in the history
  • Loading branch information
acabal committed Jan 5, 2025
1 parent 6cb3330 commit 6c6cb72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions se/se_epub_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
"t-074", "Extended sound using hyphen-minus [text]-[/] instead of non-breaking hyphen [text]‑[/]."
"t-075", "Word in verse with acute accent for scansion instead of grave accent."
"t-076", "Grapheme or phoneme not italicized. Hint: Dialect with missing letters should mark missing letters with [text]’[/]."
"t-077", "Punctuation followed by opening quotation."
XHTML
Expand Down Expand Up @@ -2812,6 +2813,10 @@ def _lint_xhtml_typography_checks(filename: Path, dom: se.easy_xml.EasyXmlTree,
if nodes:
messages.append(LintMessage("t-076", "Grapheme or phoneme not italicized. Hint: Dialect with missing letters should mark missing letters with [text]’[/].", se.MESSAGE_TYPE_WARNING, filename, nodes))

nodes = dom.xpath("/html/body//text()[re:test(., '[:;!\\?][“‘]')]")
if nodes:
messages.append(LintMessage("t-077", "Punctuation followed by opening quotation.", se.MESSAGE_TYPE_WARNING, filename, nodes))

return (messages, missing_files)

def _lint_xhtml_xhtml_checks(filename: Path, dom: se.easy_xml.EasyXmlTree, file_contents: str, local_css_path: str) -> list:
Expand Down

0 comments on commit 6c6cb72

Please sign in to comment.