Strip mailto: when yanking a hint

Resolves #61.
This commit is contained in:
Jan Verbeek 2017-01-21 14:43:50 +01:00
parent 3584eabd6f
commit 2700739a3a
3 changed files with 18 additions and 0 deletions

View File

@ -236,6 +236,7 @@ class HintActions:
utils.supports_selection())
urlstr = url.toString(QUrl.FullyEncoded | QUrl.RemovePassword)
urlstr = urlstr.lstrip('mailto:')
utils.set_clipboard(urlstr, selection=sel)
msg = "Yanked URL to {}: {}".format(

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Email address</title>
</head>
<body>
<a href="mailto:nobody">Email address</a>
</body>
</html>

View File

@ -110,6 +110,12 @@ Feature: Using hints
And I hint with args "links yank-primary" and follow a
Then the clipboard should contain "http://localhost:(port)/data/hello.txt"
Scenario: Yanking email address to clipboard
When I run :debug-set-fake-clipboard
And I open data/email_address.html
And I hint with args "links yank" and follow a
Then the clipboard should contain "nobody"
Scenario: Rapid hinting
When I open data/hints/rapid.html in a new tab
And I run :tab-only