Skip to content

Commit 5a03470

Browse files
authored
Merge pull request #366 from xxyzz/analyze
Don't skip redirect pages in `Wtp.analyze_templates()`
2 parents f2e72e5 + f721feb commit 5a03470

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Diff for: src/wikitextprocessor/core.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -944,13 +944,12 @@ def analyze_templates(
944944
included_map: defaultdict[str, set[str]] = defaultdict(set)
945945

946946
for page in self.get_all_pages([template_ns_id]):
947-
if page.body is not None:
948-
used_templates, pre_expand = check_template_func(self, page)
949-
for used_template in used_templates:
950-
included_map[used_template].add(page.title)
951-
if pre_expand:
952-
self.set_template_pre_expand(page.title)
953-
expand_stack.append(page)
947+
used_templates, pre_expand = check_template_func(self, page)
948+
for used_template in used_templates:
949+
included_map[used_template].add(page.title)
950+
if pre_expand:
951+
self.set_template_pre_expand(page.title)
952+
expand_stack.append(page)
954953

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

0 commit comments

Comments
 (0)