diff --git a/bots/markpages.py b/bots/markpages.py index d47b5c1..91df1ab 100644 --- a/bots/markpages.py +++ b/bots/markpages.py @@ -26,6 +26,7 @@ Bot to mark pages which were/are subjects of redundance discussions with templates """ +import re from datetime import datetime import pywikibot @@ -225,8 +226,8 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat() # Filter one linebreak if isinstance( self.current_wikicode.get( insert_after_index + 1), mwparser.nodes.text.Text ) and \ - self.current_wikicode.get( - insert_after_index + 1 ).value is "\n": + re.search( r"^\n\s+$", self.current_wikicode.get( + insert_after_index + 1 ).value ): insert_after_index += 1