Allow camel-case DOM elements defined in SVG-1.1
The SVG standard defines several DOM elements in camel-case (namely textPath, altGlyph, altGlyphDef, altGlyphItem and glyphRef). Even though most browser also accept lower-case, the lexer should take this into account.
This commit is contained in:
@@ -129,7 +129,7 @@ class LessLexer:
|
||||
elif v in css.propertys:
|
||||
t.type = 'css_property'
|
||||
t.value = t.value.strip()
|
||||
elif v.lower() in dom.html:
|
||||
elif v in dom.html or v.lower() in dom.html:
|
||||
t.type = 'css_dom'
|
||||
elif c == '@':
|
||||
v = v.lower()
|
||||
|
||||
@@ -51,3 +51,12 @@ tspan {
|
||||
text tspan {
|
||||
font-weight: bold;
|
||||
}
|
||||
textPath {
|
||||
font-weight: bold;
|
||||
}
|
||||
text textPath {
|
||||
font-weight: bold;
|
||||
}
|
||||
svg text textPath {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
3
lesscpy/test/css/svg.min.css
vendored
3
lesscpy/test/css/svg.min.css
vendored
@@ -13,3 +13,6 @@ tref{font-weight:bold;}
|
||||
text tref{font-weight:bold;}
|
||||
tspan{font-weight:bold;}
|
||||
text tspan{font-weight:bold;}
|
||||
textPath{font-weight:bold;}
|
||||
text textPath{font-weight:bold;}
|
||||
svg text textPath{font-weight:bold;}
|
||||
|
||||
@@ -33,7 +33,6 @@ tref { font-weight: bold; }
|
||||
text tref { font-weight: bold; }
|
||||
tspan { font-weight: bold; }
|
||||
text tspan { font-weight: bold; }
|
||||
/* NOTE(saschpe): TODO
|
||||
textPath { font-weight: bold; }
|
||||
text textPath { font-weight: bold; }
|
||||
svg text textPath { font-weight: bold; } */
|
||||
svg text textPath { font-weight: bold; }
|
||||
|
||||
Reference in New Issue
Block a user