diff --git a/clean_commonscat.py b/clean_commonscat.py index 030cd6f..ea3ae80 100644 --- a/clean_commonscat.py +++ b/clean_commonscat.py @@ -40,7 +40,9 @@ def setup(self): ns = '|'.join(self.site.namespaces[14]) self.empty_sectionR = re.compile( r'\s*\n==+ *Externí odkazy *==+ *\n\s*' - fr'(?:^==|^\{\{(?:{templates})|^\[\[(?:{ns}):)', flags=re.M) + r'^(?:==|\{\{(?:{templates})|\[\[(?:{ns}):)' + .format(templates=templates, ns=ns), + flags=re.M) def treat_page(self): # todo: treat_page_and_item page = self.current_page