Skip to content

Commit

Permalink
Merge "template.py: fix failed substitution in <poem> tag"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Dec 4, 2016
2 parents eac9c99 + 4690e39 commit fce2819
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
-subst Resolves the template by putting its text directly into the
article. This is done by changing {{...}} or {{msg:...}} into
{{subst:...}}
{{subst:...}}.
Substitution is not available inside <ref>...</ref>,
<gallery>...</gallery> and <poem>...</poem> tags.
-assubst Replaces the first argument as old template with the second
argument as new template but substitutes it like -subst does.
Expand Down Expand Up @@ -221,11 +223,11 @@ def __init__(self, generator, templates, **kwargs):
if self.getOption('subst') and self.getOption('remove'):
replacements.append((templateRegex,
r'{{subst:%s\g<parameters>}}' % new))
exceptions['inside-tags'] = ['ref', 'gallery']
exceptions['inside-tags'] = ['ref', 'gallery', 'poem']
elif self.getOption('subst'):
replacements.append((templateRegex,
r'{{subst:%s\g<parameters>}}' % old))
exceptions['inside-tags'] = ['ref', 'gallery']
exceptions['inside-tags'] = ['ref', 'gallery', 'poem']
elif self.getOption('remove'):
replacements.append((templateRegex, ''))
else:
Expand Down

0 comments on commit fce2819

Please sign in to comment.