mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
jump to class: ignore case of rel attribute on link elements
This commit is contained in:
parent
83ad6604bf
commit
13c8ee358c
@ -5,11 +5,11 @@ from contextlib import suppress
|
|||||||
from typing import List, NamedTuple, Optional, Tuple
|
from typing import List, NamedTuple, Optional, Tuple
|
||||||
|
|
||||||
from css_parser.css import CSSRule
|
from css_parser.css import CSSRule
|
||||||
from css_selectors import Select, SelectorError
|
|
||||||
|
|
||||||
from calibre.ebooks.oeb.parse_utils import barename
|
from calibre.ebooks.oeb.parse_utils import barename
|
||||||
from calibre.ebooks.oeb.polish.container import get_container
|
from calibre.ebooks.oeb.polish.container import get_container
|
||||||
from calibre.ebooks.oeb.polish.parsing import parse
|
from calibre.ebooks.oeb.polish.parsing import parse
|
||||||
|
from css_selectors import Select, SelectorError
|
||||||
|
|
||||||
|
|
||||||
class NoMatchingTagFound(KeyError):
|
class NoMatchingTagFound(KeyError):
|
||||||
@ -116,7 +116,7 @@ def find_first_matching_rule(
|
|||||||
)
|
)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
return res._replace(style_tag_address=(int(tag.get(lnum_attr)), ['style']))
|
return res._replace(style_tag_address=(int(tag.get(lnum_attr)), ['style']))
|
||||||
elif tn == 'link' and tag.get('href') and tag.get('rel') == 'stylesheet':
|
elif tn == 'link' and tag.get('href') and tag.get('rel', '').lower() == 'stylesheet':
|
||||||
sname = container.href_to_name(tag.get('href'), html_file_name)
|
sname = container.href_to_name(tag.get('href'), html_file_name)
|
||||||
try:
|
try:
|
||||||
sheet = container.parsed(sname)
|
sheet = container.parsed(sname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user