From 0ad2af7730b69f1cd6d4cff425a7cee6b5c7663c Mon Sep 17 00:00:00 2001 From: j Date: Tue, 23 Oct 2018 17:26:37 +0200 Subject: [PATCH] cleanup libreoffice footnotes --- content_plugins/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content_plugins/base.py b/content_plugins/base.py index e9204e8..154f203 100644 --- a/content_plugins/base.py +++ b/content_plugins/base.py @@ -254,11 +254,13 @@ class FootnoteBase(PrepareRichtextMixin, FilesystemTemplateRendererPlugin): class RichTextFootnoteMixin: + OO_FOOTNOTES = re.compile("((.*?))") MATCH_FOOTNOTES = re.compile("(\w+)") def get_prepared_richtext(self, richtext): # Find all footnotes and convert them into links richtext = super().get_prepared_richtext(richtext) + richtext = self.OO_FOOTNOTES.subn('\g<1>', richtext)[0] rv = self.MATCH_FOOTNOTES.subn( '\" class="footnote">\">\g<1>', richtext)[0]