Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/wikitextprocessor/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,13 +944,12 @@ def analyze_templates(
included_map: defaultdict[str, set[str]] = defaultdict(set)

for page in self.get_all_pages([template_ns_id]):
if page.body is not None:
used_templates, pre_expand = check_template_func(self, page)
for used_template in used_templates:
included_map[used_template].add(page.title)
if pre_expand:
self.set_template_pre_expand(page.title)
expand_stack.append(page)
used_templates, pre_expand = check_template_func(self, page)
for used_template in used_templates:
included_map[used_template].add(page.title)
if pre_expand:
self.set_template_pre_expand(page.title)
expand_stack.append(page)

# XXX consider encoding template bodies here (also need to save related
# cookies). This could speed up their expansion, where the first
Expand Down