Browse Source

Add missing line break if there is no template

To make sure our notice template resides in its own line in every case

Related Task: [FS#141](https://fs.golderweb.de/index.php?do=details&task_id=141)
develop
Jonathan Golder 7 years ago
parent
commit
47b85a0b5e
  1. 4
      bots/markpages.py

4
bots/markpages.py

@ -236,6 +236,7 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
mwparser.nodes.comment.Comment ):
insert_after_index += 1
else:
self.current_wikicode.insert_after(
@ -249,6 +250,9 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
else:
self.current_wikicode.insert( 0, self.disc_notice )
# To have it in its own line we need to add a linbreak after it
self.current_wikicode.insert_after(self.disc_notice, "\n" )
# If there is no leadsec (and therefore no template in it, we will add
# before the first element
else:

Loading…
Cancel
Save