mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix urls not being transformed if property is followed by '}'
This commit is contained in:
parent
d21ef82385
commit
9407f7b08f
@ -718,6 +718,7 @@ class TokenQueue {
|
||||
if (process_urls(TokenType::string)) changed = true;
|
||||
}
|
||||
} else {
|
||||
if (process_urls()) changed = true;
|
||||
if (process_declaration()) changed = true;
|
||||
}
|
||||
if (changed && queue.size()) {
|
||||
|
@ -31,6 +31,7 @@ class TestTransform(SimpleTest):
|
||||
def s(src, expected, url_callback=upper_case):
|
||||
return d(src, expected, url_callback=url_callback, is_declaration=False)
|
||||
|
||||
s('.c{x:url(y)}', '.c{x:url("Y")}')
|
||||
s('@im/* c */port "x.y";', '@import "X.Y";')
|
||||
s('@import url("narrow.css") supports(display: flex) handheld and (max-width: 400px);',
|
||||
'@import url("NARROW.CSS") supports(display: flex) handheld and (max-width: 400px);')
|
||||
@ -57,3 +58,28 @@ class TestTransform(SimpleTest):
|
||||
|
||||
d('-epub-writing-mode: a; -web/* */kit-writing-mode: b; writing-mode: c', 'writing-mode: a; writing-mode: b; writing-mode: c')
|
||||
d('xxx:yyy', 'xxx:yyy')
|
||||
|
||||
sheet = '''
|
||||
@import "loc.test";
|
||||
@media screen {
|
||||
font: 16px calc(20vw - 30rem);
|
||||
|
||||
.cls {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
background: url("loc.test")
|
||||
}
|
||||
|
||||
#moo.cat {
|
||||
x: url("loc.test")
|
||||
}
|
||||
|
||||
@zoo {
|
||||
not(.woo) and why {
|
||||
font: 16px "something something" 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
.why { font: 16px}
|
||||
'''
|
||||
s(sheet, sheet.replace('16px', '1rem').replace('loc.test', 'LOC.TEST'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user