Skip listing containers whose entries hold user cards or quotes

A thread without DiscussionForumPosting markup, where every poster writes
once, still passed the teaser test: each post opens with a linked name that
no other post repeats. On katzen-forum.net with the JSON-LD removed and one
post per poster, recall took the whole container (3,573 chars, seven user
cards instead of one).

Teasers hold neither a description list nor a quote, while forum posts keep
the poster's user card in one and quote each other, so an entry holding
either now rules the container out.
This commit is contained in:
dualfroz committed 2026-10-10 15:34:44 +02:00
1 parent 77465a50e7
commit 06c7822f79
2 files changed
+23 -11

No files matched your search

+4 -1
View File
@@ -665,9 +665,12 @@ def _holds_most_of_the_text(tree: HtmlElement, expr: XPath) -> bool:
def _entries_link_out(container: _Element) -> bool:
"""Whether every entry of the container is a teaser: its first heading links to a page of its
own, which no other entry links to. Forum posts share the shape but open with the poster's
name, which comes back along the thread or carries no link at all."""
name, which comes back along the thread or carries no link at all, and they hold user cards
(description lists) and quotes, which teasers do not."""
targets: set[str] = set()
for entry in container.iterchildren("article"):
if entry.find(".//list[@rend='dl']") is not None or entry.find(".//quote") is not None:
return False
heading = entry.find(".//head")
link = heading.find(".//ref") if heading is not None else None
if link is None: