Skip to content

Commit 517acfd

Browse files
Comment on the redirect normalization rule.
1 parent 4572a7d commit 517acfd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

generate.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ def write_redirects(aggregate: AggregateIndex, data: Data, output_dir: Path):
7878
else:
7979
redirects[f'/{script}*'] = f'/{chapter_indices[0]}/{script}.html'
8080

81+
# MediaWiki legacy parser requires titles to be in a
82+
# MediaWiki-normalized form in order to be able to link to them using
83+
# interwiki links. Therefore, multiple underscores are normalized to a
84+
# single one upon linking, which creates a problem. To address this, we
85+
# create redirects from the normalized forms to the actual script names
86+
# until we can switch to Parsoid.
8187
normalized = UNDERSCORE_NORMALIZATION_REGEX.sub('_', script)
8288
if script != normalized and normalized not in aggregate:
8389
for idx in chapter_indices:

0 commit comments

Comments
 (0)