paste links as anchors if shift held down

This commit is contained in:
Damien Elmes 2018-11-12 16:39:24 +10:00
parent ed411b0cc9
commit 7f85218b5a

View file

@ -921,6 +921,12 @@ class EditorWebView(AnkiWebView):
if link:
return link
# not media; add it as a normal link if pasting with shift
link = '<a href="{}">{}</a>'.format(
url, html.escape(txt)
)
return link
# normal text; convert it to HTML
txt = html.escape(txt)
txt = txt.replace("\n", "<br>")