jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/342314 )
Change subject: template.py: substitution fails if template is inside pagelist tag ......................................................................
template.py: substitution fails if template is inside pagelist tag
add <pagelist /> to the list of tags managed by textlib._create_default_regexes()
Bug: T151940 Change-Id: I972bb91fa58ca3b3ec6b5982066a76cfc38510c1 --- M pywikibot/textlib.py M scripts/template.py 2 files changed, 6 insertions(+), 2 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 7aad950..88adc31 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -258,6 +258,8 @@ # files 'file': (FILE_LINK_REGEX, lambda site: '|'.join(site.namespaces[6])), + # pagelist tag (used in Proofread extension). + 'pagelist': re.compile(r'(?is)<pagelist.*?/>'), })
diff --git a/scripts/template.py b/scripts/template.py index 334c226..8371e5b 100755 --- a/scripts/template.py +++ b/scripts/template.py @@ -223,11 +223,13 @@ if self.getOption('subst') and self.getOption('remove'): replacements.append((templateRegex, r'{{subst:%s\g<parameters>}}' % new)) - exceptions['inside-tags'] = ['ref', 'gallery', 'poem'] + exceptions['inside-tags'] = ['ref', 'gallery', 'poem', + 'pagelist', ] elif self.getOption('subst'): replacements.append((templateRegex, r'{{subst:%s\g<parameters>}}' % old)) - exceptions['inside-tags'] = ['ref', 'gallery', 'poem'] + exceptions['inside-tags'] = ['ref', 'gallery', 'poem', + 'pagelist', ] elif self.getOption('remove'): replacements.append((templateRegex, '')) else:
pywikibot-commits@lists.wikimedia.org