Repository navigation
Commit 82c82f2
textlib: Reject nested wikilinks in file captions
Do not match a file link when a wikilink in its caption contains
another wikilink. MediaWiki treats this malformed markup as plain
text, so replaceExcept must not skip replacements there.
Prevent the single-bracket fallback from accepting double brackets.
Require each repeated caption alternative to consume characters, avoiding
empty matches that hang the PyPy regex engine on malformed captions.
Keep the existing unbalanced input as a regression test, preserving
its brackets and replacing both x occurrences. Remove expectedFailure
and rename the test to describe the malformed input.
Bug: T396721
Change-Id: Ib1cec8ddd36d1b2454bf176603e841413d9e0b881 parent 00780a9 commit 82c82f2
2 files changed
Lines changed: 13 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| |||
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
101 | 99 | | |
102 | | - | |
| 100 | + | |
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
106 | | - | |
| 104 | + | |
107 | 105 | | |
108 | 106 | | |
109 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1448 | 1448 | | |
1449 | 1449 | | |
1450 | 1450 | | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
1456 | 1455 | | |
1457 | 1456 | | |
1458 | 1457 | | |
1459 | 1458 | | |
1460 | | - | |
| 1459 | + | |
1461 | 1460 | | |
1462 | 1461 | | |
1463 | 1462 | | |
| |||
0 commit comments