From bddf3d0983c3a28fe456e253634f67c98c81aa88 Mon Sep 17 00:00:00 2001 From: Benjamin Somers Date: Fri, 24 May 2024 13:57:33 +0200 Subject: [PATCH] Fix extensions for recent python3-markdown and suppress warning Signed-off-by: Benjamin Somers --- extensions/format_details.py | 6 +++--- extensions/include_toc.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/format_details.py b/extensions/format_details.py index e1a81b09..5fe682e3 100644 --- a/extensions/format_details.py +++ b/extensions/format_details.py @@ -22,7 +22,7 @@ def run(self, lines): # it in the required format. details = 1 - match = re.search('\[details=(.+)\]', line) + match = re.search(r'\[details=(.+)\]', line) if match: new_lines.append("??? details "+match.group(1)+"\n") else: @@ -52,5 +52,5 @@ def run(self, lines): class FormatDetailsExtension (Extension): - def extendMarkdown(self, md, md_globals): - md.preprocessors.add('formatdetails', FixFormatting(md), '_begin') + def extendMarkdown(self, md): + md.preprocessors.register(FixFormatting(md), 'formatdetails', 9999) diff --git a/extensions/include_toc.py b/extensions/include_toc.py index 7d2e3f76..dfa937a1 100644 --- a/extensions/include_toc.py +++ b/extensions/include_toc.py @@ -38,5 +38,5 @@ def run(self, lines): class IncludeToCExtension (Extension): - def extendMarkdown(self, md, md_globals): - md.preprocessors.add('includetoc', InsertToCStuff(md), '_begin') + def extendMarkdown(self, md): + md.preprocessors.register(InsertToCStuff(md), 'includetoc', 9999)