jenkins-bot has submitted this change and it was merged.
Change subject: Find correct line feed in text, fix for right placement of header with noreferences.py (Bug 55409) (update from compat gerrit 88121) ......................................................................
Find correct line feed in text, fix for right placement of header with noreferences.py (Bug 55409) (update from compat gerrit 88121)
Change-Id: I9de67bfb3713106c30d26af9c6faf30c0156c4df --- M scripts/noreferences.py 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/noreferences.py b/scripts/noreferences.py index 8c8e0dd..cb857e0 100755 --- a/scripts/noreferences.py +++ b/scripts/noreferences.py @@ -480,7 +480,7 @@ """ # Is there an existing section where we can add the references tag? for section in pywikibot.translate(self.site, referencesSections): - sectionR = re.compile(r'\r\n=+ *%s *=+ *\r\n' % section) + sectionR = re.compile(r'\r?\n=+ *%s *=+ *\r?\n' % section) index = 0 while index < len(oldText): match = sectionR.search(oldText, index) @@ -502,7 +502,7 @@ # Create a new section for the references tag for section in pywikibot.translate(self.site, placeBeforeSections): # Find out where to place the new section - sectionR = re.compile(r'\r\n(?P<ident>=+) *%s *(?P=ident) *\r\n' + sectionR = re.compile(r'\r?\n(?P<ident>=+) *%s *(?P=ident) *\r?\n' % section) index = 0 while index < len(oldText): @@ -541,9 +541,9 @@ ### {{commons}} or {{commonscat}} are part of Weblinks section ### * {{template}} is mostly part of a section ### so templatePattern must be fixed - templatePattern = r'\r\n{{((?!}}).)+?}}\s*' + templatePattern = r'\r?\n{{((?!}}).)+?}}\s*' commentPattern = r'<!--((?!-->).)*?-->\s*' - metadataR = re.compile(r'(\r\n)?(%s|%s|%s|%s)$' + metadataR = re.compile(r'(\r?\n)?(%s|%s|%s|%s)$' % (categoryPattern, interwikiPattern, templatePattern, commentPattern), re.DOTALL) tmpText = oldText
pywikibot-commits@lists.wikimedia.org