Skip to content

Commit

Permalink
Support removal of templates as well
Browse files Browse the repository at this point in the history
  • Loading branch information
HazardSJ committed May 28, 2013
1 parent 7c12d35 commit 51c1668
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions citationstyle.py
Expand Up @@ -41,6 +41,10 @@ def replaceWikilinks(template, URL, title):
self.code.replace(link, link.text)
else:
self.code.replace(link, link.title)
temps = template.get(title).value.filter_templates()
if temps:
for temp in temps:
self.code.remove(temp)
## @fixme: Use a function, and use {{Cite doi}} as well, just in case...
## ...or generate from [[Category:Citation Style 1 templates]]? (doesn't include {{citation}} though)
#template = pywikibot.Page(self.site, "Template:Cite web")
Expand Down

0 comments on commit 51c1668

Please sign in to comment.