From 7f85218b5a9db647869db20d0e7f8b6c3c2c8a99 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 12 Nov 2018 16:39:24 +1000 Subject: [PATCH] paste links as anchors if shift held down --- aqt/editor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aqt/editor.py b/aqt/editor.py index 86d1dcdc7..5e3aa10af 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -921,6 +921,12 @@ class EditorWebView(AnkiWebView): if link: return link + # not media; add it as a normal link if pasting with shift + link = '{}'.format( + url, html.escape(txt) + ) + return link + # normal text; convert it to HTML txt = html.escape(txt) txt = txt.replace("\n", "
")