Improve regex for blank lines

Do not match consecutive linebreaks as one

Related Task: [FS#141](https://fs.golderweb.de/index.php?do=details&task_id=141)
This commit is contained in:
2017-08-24 18:47:18 +02:00
parent 9b9d50c4d2
commit 642a29b022

View File

@@ -227,7 +227,7 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
# Filter one linebreak # Filter one linebreak
if isinstance( self.current_wikicode.get( if isinstance( self.current_wikicode.get(
insert_after_index + 1), mwparser.nodes.text.Text ) and \ insert_after_index + 1), mwparser.nodes.text.Text ) and \
re.search( r"^\n\s+$", self.current_wikicode.get( re.search( r"^\n[^\n\S]+$", self.current_wikicode.get(
insert_after_index + 1 ).value ): insert_after_index + 1 ).value ):
insert_after_index += 1 insert_after_index += 1