diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index b895c7db1..065da7114 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -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( diff --git a/tests/end2end/data/email_address.html b/tests/end2end/data/email_address.html new file mode 100644 index 000000000..3c86446ad --- /dev/null +++ b/tests/end2end/data/email_address.html @@ -0,0 +1,11 @@ + + + + + + Email address + + + Email address + + diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index 8d23d0199..18b36e6e8 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -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