Fix lines which are now too long
This commit is contained in:
parent
b791095324
commit
01b7b27bda
@ -281,13 +281,15 @@ class WebKitCaret(browsertab.AbstractCaret):
|
|||||||
selected_element = xml.etree.ElementTree.fromstring(
|
selected_element = xml.etree.ElementTree.fromstring(
|
||||||
'<html>{}</html>'.format(selection)).find('a')
|
'<html>{}</html>'.format(selection)).find('a')
|
||||||
except xml.etree.ElementTree.ParseError:
|
except xml.etree.ElementTree.ParseError:
|
||||||
raise browsertab.WebTabError('Could not parse selected element!')
|
raise browsertab.WebTabError('Could not parse selected '
|
||||||
|
'element!')
|
||||||
|
|
||||||
if selected_element is not None:
|
if selected_element is not None:
|
||||||
try:
|
try:
|
||||||
url = selected_element.attrib['href']
|
url = selected_element.attrib['href']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise browsertab.WebTabError('Anchor element without href!')
|
raise browsertab.WebTabError('Anchor element without '
|
||||||
|
'href!')
|
||||||
url = self._tab.url().resolved(QUrl(url))
|
url = self._tab.url().resolved(QUrl(url))
|
||||||
if tab:
|
if tab:
|
||||||
self._tab.new_tab_requested.emit(url)
|
self._tab.new_tab_requested.emit(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user