From 1f0c7e10a19e3595b185f84d912ae12e4d2ab35f Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Wed, 1 Mar 2023 16:49:37 -0600 Subject: [PATCH] More updates --- src/wiki/core/markdown/mdx/responsivetable.py | 2 +- src/wiki/plugins/links/mdx/djangowikilinks.py | 2 +- src/wiki/plugins/links/mdx/urlize.py | 6 +++--- src/wiki/plugins/macros/mdx/wikilinks.py | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/wiki/core/markdown/mdx/responsivetable.py b/src/wiki/core/markdown/mdx/responsivetable.py index 86a224f1..56d7875d 100644 --- a/src/wiki/core/markdown/mdx/responsivetable.py +++ b/src/wiki/core/markdown/mdx/responsivetable.py @@ -1,6 +1,6 @@ +from xml.etree import ElementTree as etree import markdown from markdown.treeprocessors import Treeprocessor -from markdown.util import etree class ResponsiveTableExtension(markdown.Extension): diff --git a/src/wiki/plugins/links/mdx/djangowikilinks.py b/src/wiki/plugins/links/mdx/djangowikilinks.py index 3d5817a6..cae2e0fa 100755 --- a/src/wiki/plugins/links/mdx/djangowikilinks.py +++ b/src/wiki/plugins/links/mdx/djangowikilinks.py @@ -17,9 +17,9 @@ Dependencies: * [Markdown 2.6+](https://pypi.python.org/pypi/Markdown) """ from os import path as os_path +from xml.etree import ElementTree as etree import markdown -from markdown.util import etree from wiki import models diff --git a/src/wiki/plugins/links/mdx/urlize.py b/src/wiki/plugins/links/mdx/urlize.py index 6e26a0f2..b6b50022 100644 --- a/src/wiki/plugins/links/mdx/urlize.py +++ b/src/wiki/plugins/links/mdx/urlize.py @@ -1,5 +1,5 @@ import re - +from xml.etree import ElementTree as etree import markdown # Regular expression is meant to match the following pattern: @@ -138,11 +138,11 @@ class UrlizePattern(markdown.inlinepatterns.Pattern): return url # Convenience link to distinguish external links more easily. - icon = markdown.util.etree.Element("span") + icon = etree.Element("span") icon.set("class", "fa fa-external-link") # Link text. - span_text = markdown.util.etree.Element("span") + span_text = etree.Element("span") span_text.text = markdown.util.AtomicString(" " + text) # Set-up link itself. diff --git a/src/wiki/plugins/macros/mdx/wikilinks.py b/src/wiki/plugins/macros/mdx/wikilinks.py index 268373ec..5acb8ffe 100644 --- a/src/wiki/plugins/macros/mdx/wikilinks.py +++ b/src/wiki/plugins/macros/mdx/wikilinks.py @@ -2,6 +2,7 @@ Extend the shipped Markdown extension 'wikilinks' """ import re +from xml.etree import ElementTree as etree import markdown from django.urls import reverse @@ -49,7 +50,7 @@ class WikiLinks(wikilinks.WikiLinksInlineProcessor): base_url, end_url, html_class = self._getMeta() label = m.group(1).strip() url = self.config["build_url"](label, base_url, end_url, self.md) - a = markdown.util.etree.Element("a") + a = etree.Element("a") a.text = label a.set("href", url) if html_class: -- 2.45.2