mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(rendercomment): markdown.util.etree -> xml.etree.ElementTree
This removes a deprecation warning. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
2d0e09cd63
commit
bc1cf8b1f6
1 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from xml.etree.ElementTree import Element
|
||||||
|
|
||||||
import bleach
|
import bleach
|
||||||
import markdown
|
import markdown
|
||||||
import pygit2
|
import pygit2
|
||||||
|
@ -40,7 +42,7 @@ class FlysprayLinksInlineProcessor(markdown.inlinepatterns.InlineProcessor):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def handleMatch(self, m, data):
|
def handleMatch(self, m, data):
|
||||||
el = markdown.util.etree.Element('a')
|
el = Element('a')
|
||||||
el.set('href', f'https://bugs.archlinux.org/task/{m.group(1)}')
|
el.set('href', f'https://bugs.archlinux.org/task/{m.group(1)}')
|
||||||
el.text = markdown.util.AtomicString(m.group(0))
|
el.text = markdown.util.AtomicString(m.group(0))
|
||||||
return (el, m.start(0), m.end(0))
|
return (el, m.start(0), m.end(0))
|
||||||
|
@ -73,7 +75,7 @@ class GitCommitsInlineProcessor(markdown.inlinepatterns.InlineProcessor):
|
||||||
# Unkwown OID; preserve the orginal text.
|
# Unkwown OID; preserve the orginal text.
|
||||||
return (None, None, None)
|
return (None, None, None)
|
||||||
|
|
||||||
el = markdown.util.etree.Element('a')
|
el = Element('a')
|
||||||
commit_uri = aurweb.config.get("options", "commit_uri")
|
commit_uri = aurweb.config.get("options", "commit_uri")
|
||||||
prefixlen = util.git_search(self._repo, oid)
|
prefixlen = util.git_search(self._repo, oid)
|
||||||
el.set('href', commit_uri % (self._head, oid[:prefixlen]))
|
el.set('href', commit_uri % (self._head, oid[:prefixlen]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue