mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
paste links as anchors if shift held down
This commit is contained in:
parent
ed411b0cc9
commit
7f85218b5a
1 changed files with 6 additions and 0 deletions
|
@ -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>")
|
||||
|
|
Loading…
Reference in a new issue