jenkins-bot merged this change.
[bugfix] Make sure that header regex doesn't span multiple lines
The regex for removeDisabledParts is compiled with dotall (singleline)
flag. This made the dot match across lines and remove the content between
the first and last headline.
Change-Id: Ia9151ca97fbf8c5b98aeb952324ed6e03473b94c
---
M pywikibot/textlib.py
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 990d40c..b921002 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -267,7 +267,7 @@
# section headers
'header': re.compile(
r'(?:(?<=\n)|\A)(?:<!--[\s\S]*?-->)*'
- r'=(?:.|<!--[\s\S]*?-->)+='
+ r'=(?:[^\n]|<!--[\s\S]*?-->)+='
r' *(?:<!--[\s\S]*?--> *)*(?=\n|\Z)'),
# external links
'hyperlink': compileLinkR(),
To view, visit change 528114. To unsubscribe, or for help writing mail filters, visit settings.