diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index ff303c637..4d9cbfdb9 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -27,6 +27,7 @@ Changed - Scrolling with the scrollwheel while holding shift now scrolls sideways - New way of clicking hints with which solves various small issues +- When yanking a mailto: link via hints, the mailto: prefix is now stripped Fixed ----- diff --git a/README.asciidoc b/README.asciidoc index bbd6277a5..6c6214340 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -146,8 +146,8 @@ Contributors, sorted by the number of commits in descending order: * Florian Bruhin * Daniel Schadt * Ryan Roden-Corrent -* Jakub Klinkovský * Jan Verbeek +* Jakub Klinkovský * Antoni Boucher * Lamar Pavel * Marshall Lochbaum diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index b895c7db1..ece6ed89e 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -235,7 +235,10 @@ class HintActions: sel = (context.target == Target.yank_primary and utils.supports_selection()) - urlstr = url.toString(QUrl.FullyEncoded | QUrl.RemovePassword) + flags = QUrl.FullyEncoded | QUrl.RemovePassword + if url.scheme() == 'mailto': + flags |= QUrl.RemoveScheme + urlstr = url.toString(flags) 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 9cd91f151..27b7ec54f 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -99,6 +99,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