File: 0001-Swap-mistune-for-mistune0.patch

package info (click to toggle)
lektor 3.3.7-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,952 kB
  • sloc: python: 14,073; javascript: 77; makefile: 37; sh: 7; xml: 1
file content (61 lines) | stat: -rw-r--r-- 1,742 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From: =?utf-8?b?SsOpcsO0bWUgQ2hhcmFvdWk=?= <jerome@riseup.net>
Date: Wed, 4 Jan 2023 10:05:39 -0500
Subject: Swap mistune for mistune0

In debian the mistune package is version 2 and later, which is not
compatible with Lektor 3.3.x and earlier.

Forwarded: not-needed
---
 lektor/markdown.py | 8 ++++----
 setup.cfg          | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lektor/markdown.py b/lektor/markdown.py
index 2244037..862bab7 100644
--- a/lektor/markdown.py
+++ b/lektor/markdown.py
@@ -1,7 +1,7 @@
 import threading
 from weakref import ref as weakref
 
-import mistune
+import mistune0
 from markupsafe import Markup
 from werkzeug.urls import url_parse
 
@@ -12,10 +12,10 @@ _markdown_cache = threading.local()
 
 
 def escape(text: str) -> str:
-    return mistune.escape(text, quote=True)
+    return mistune0.escape(text, quote=True)
 
 
-class ImprovedRenderer(mistune.Renderer):
+class ImprovedRenderer(mistune0.Renderer):
     def link(self, link, title, text):
         if self.record is not None:
             url = url_parse(link)
@@ -59,7 +59,7 @@ def make_markdown(env):
     env.plugin_controller.emit("markdown-config", config=cfg)
     renderer = cfg.make_renderer()
     env.plugin_controller.emit("markdown-lexer-config", config=cfg, renderer=renderer)
-    return mistune.Markdown(renderer, **cfg.options)
+    return mistune0.Markdown(renderer, **cfg.options)
 
 
 def markdown_to_html(text, record=None):
diff --git a/setup.cfg b/setup.cfg
index f576c1a..abf02f0 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -42,7 +42,7 @@ install_requires =
     Flask
     inifile>=0.4.1
     Jinja2>=3.0
-    mistune>=0.7.0,<2
+    mistune0>=0.7.0,<2
     pip
     python-slugify
     requests[security]