From 8369140b72d2061b30f1025683c6ed77952db295 Mon Sep 17 00:00:00 2001 From: Samuel Loury Date: Thu, 9 Jun 2016 08:23:53 +0200 Subject: [PATCH 1/2] Strip the url before processing it This won't hurt and will help with some poorly formatted sites including blank spaces around the url (e.g. the Previous link in a dashboard make with CDash 2.0.2). --- qutebrowser/browser/hints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 3f465cfce..3bb172300 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -604,7 +604,7 @@ class HintManager(QObject): """ for attr in ('href', 'src'): if attr in elem: - text = elem[attr] + text = elem[attr].strip() break else: return None From a69610077ed25e2e1477090b92fe28053f70c80a Mon Sep 17 00:00:00 2001 From: Samuel Loury Date: Thu, 9 Jun 2016 08:36:10 +0200 Subject: [PATCH 2/2] Add a test about a href with spaces around --- tests/end2end/data/hints/html/with_spaces.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/end2end/data/hints/html/with_spaces.html diff --git a/tests/end2end/data/hints/html/with_spaces.html b/tests/end2end/data/hints/html/with_spaces.html new file mode 100644 index 000000000..d2ff52371 --- /dev/null +++ b/tests/end2end/data/hints/html/with_spaces.html @@ -0,0 +1,14 @@ + + + + + + + + Simple link + + + Follow me! + +