File python-django-waliki-use-newer-markups-api.patch of Package python-django-waliki
From 4320f6ee4803229e3706125a3cc7bcbb79e24786 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Sat, 7 Mar 2020 23:04:58 +0000
Subject: [PATCH] Use newer Markups API instead of deprecated one.
Part accessing methods of AbstractMarkup like get_document_body()
are deprecated in MArkups 2.0.0 and removed in 3.0.0 in favour of
explicit conversion to ConvertedMarkup using convert() method
and then accessing its parts.
This change makes Waliki use this updated API.
Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
waliki/models.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/waliki/models.py b/waliki/models.py
index 8eb6707..3bade31 100644
--- a/waliki/models.py
+++ b/waliki/models.py
@@ -124,7 +124,7 @@ class Page(models.Model):
@staticmethod
def preview(markup, text):
- content = Page.get_markup_instance(markup).get_document_body(text)
+ content = Page.get_markup_instance(markup).convert(text).get_document_body()
content= sanitize(content)
return content
@@ -136,7 +136,7 @@ class Page(models.Model):
def _get_part(self, part):
try:
- return getattr(self.markup_, part)(self.raw)
+ return getattr(self.markup_.convert(self.raw), part)()
except SystemMessage:
return ''
--
2.24.1