diff --git a/se/se_epub_lint.py b/se/se_epub_lint.py index 7a277ba1..31cd11be 100644 --- a/se/se_epub_lint.py +++ b/se/se_epub_lint.py @@ -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 @@ -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: