paste links as anchors if shift held down

This commit is contained in:
Damien Elmes 2018-11-12 16:39:24 +10:00
parent ee88b22985
commit 0814d02c5f

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>")