From 06fff572b84c8a21828cf47a1a924b95f974d57f Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Sun, 14 Jul 2024 10:25:09 -0400 Subject: [PATCH] Remove pointless trailing text from t-008 regex This regex is being used to return a set of nodes, not match substrings, so the trailing context is irrelevant. The lint messages contain the result of calling to_string on the nodes. --- se/se_epub_lint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/se/se_epub_lint.py b/se/se_epub_lint.py index 22309d4e..c37753ec 100644 --- a/se/se_epub_lint.py +++ b/se/se_epub_lint.py @@ -3365,7 +3365,7 @@ def lint(self, skip_lint_ignore: bool, allowed_messages: Optional[List[str]] = N messages.append(LintMessage("f-001", "Illegal file or directory.", se.MESSAGE_TYPE_ERROR, Path(illegal_file))) # Check for repeated punctuation - nodes = self.metadata_dom.xpath("/package/metadata/*[re:test(., '[,;]{2,}.{0,20}')]") + nodes = self.metadata_dom.xpath("/package/metadata/*[re:test(., '[,;]{2,}')]") if nodes: messages.append(LintMessage("t-008", "Repeated punctuation.", se.MESSAGE_TYPE_WARNING, self.metadata_file_path, [node.to_string() for node in nodes]))