From 47b85a0b5eb7521544e47cb4e4d4e630b037ed91 Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Mon, 21 Aug 2017 22:09:59 +0200 Subject: [PATCH] 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) --- bots/markpages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bots/markpages.py b/bots/markpages.py index 354532d..4e12620 100644 --- a/bots/markpages.py +++ b/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: