diff --git a/se/se_epub_lint.py b/se/se_epub_lint.py index 89b66c8e..88990e31 100644 --- a/se/se_epub_lint.py +++ b/se/se_epub_lint.py @@ -2248,7 +2248,7 @@ def _lint_xhtml_syntax_checks(self, filename: Path, dom: se.easy_xml.EasyXmlTree # Check for common missing roman semantics for “I” regent_regex = r"(?:Charles|Edward|George|Henry|James|William) I\b" - matches = regex.findall(fr"King {regent_regex}", file_contents) + regex.findall(fr"{regent_regex}’s", file_contents) + matches = regex.findall(fr"King {regent_regex}|{regent_regex}’s", file_contents) if matches: messages.append(LintMessage("s-103", "Probable missing semantics for a roman I numeral.", se.MESSAGE_TYPE_WARNING, filename, matches)) diff --git a/tests/lint/semantic/s-103/golden/s-103-out.txt b/tests/lint/semantic/s-103/golden/s-103-out.txt new file mode 100644 index 00000000..9d6cc84f --- /dev/null +++ b/tests/lint/semantic/s-103/golden/s-103-out.txt @@ -0,0 +1,20 @@ +s-103 [Manual Review] chapter-1.xhtml Probable missing semantics for a roman I +numeral. + Charles I’s + Edward I’s + George I’s + Henry I’s + James I’s + William I’s + King Charles I + King Edward I + King George I + King Henry I + King James I + King William I + King Charles I + King Edward I + King George I + King Henry I + King James I + King William I diff --git a/tests/lint/semantic/s-103/in/src/epub/text/chapter-1.xhtml b/tests/lint/semantic/s-103/in/src/epub/text/chapter-1.xhtml new file mode 100644 index 00000000..f0384943 --- /dev/null +++ b/tests/lint/semantic/s-103/in/src/epub/text/chapter-1.xhtml @@ -0,0 +1,29 @@ + + + + I + + +
+

I

+

Charles I’s.

+

Edward I’s.

+

George I’s.

+

Henry I’s.

+

James I’s.

+

William I’s.

+

King Charles I.

+

King Edward I.

+

King George I.

+

King Henry I.

+

King James I.

+

King William I.

+

King Charles I’s.

+

King Edward I’s.

+

King George I’s.

+

King Henry I’s.

+

King James I’s.

+

King William I’s.

+
+ +