Skip to content

Commit

Permalink
Disable M-035 for white-label productions
Browse files Browse the repository at this point in the history
Such productions may contain a colophon, but don't necessarily use the
same identifier format as Standard Ebooks.

Arguably all of these special-file checks could be disabled for
white-label productions, but this one stands out as not applying.
  • Loading branch information
apasel422 committed Jun 21, 2024
1 parent 63faa54 commit a3b9d78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion se/se_epub_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ def _lint_special_file_checks(self, filename: Path, dom: se.easy_xml.EasyXmlTree
messages.append(LintMessage("s-016", "Incorrect [text]the[/] before Google Books link.", se.MESSAGE_TYPE_ERROR, filename, ["the<br/>\n" + node.to_string() for node in nodes]))

se_url = self.generated_identifier.replace("url:", "")
if not dom.xpath(f"/html/body//a[@href='{se_url}' and text()='{se_url.replace('https://', '')}']"):
if self.is_se_ebook and not dom.xpath(f"/html/body//a[@href='{se_url}' and text()='{se_url.replace('https://', '')}']"):
messages.append(LintMessage("m-035", f"Unexpected S.E. identifier in colophon. Expected: [url]{se_url}[/].", se.MESSAGE_TYPE_ERROR, filename))

if self.metadata_dom.xpath("/package/metadata/meta[@property='role' and text()='trl']") and "translated from" not in file_contents:
Expand Down

0 comments on commit a3b9d78

Please sign in to comment.