@ -164,7 +164,7 @@ def parse_enum(prop, value):
|
||||
def parse_line_style(prop, value) -> float:
|
||||
if value == "sloppy":
|
||||
return 0.5
|
||||
elif isinstance(value, tuple):
|
||||
elif isinstance(value, tuple) and len(value) == 2:
|
||||
style, factor = value
|
||||
if style == "sloppy":
|
||||
if not isinstance(factor, number):
|
||||
|
@ -207,3 +207,13 @@ def test_line_style(css_value, result):
|
||||
props = compiled_style_sheet.match(Node("mytype"))
|
||||
|
||||
assert props.get("line-style") == result
|
||||
|
||||
|
||||
def test_broken_line_style():
|
||||
# diagram css is missing the closing bracket
|
||||
css = "diagram { line-style: sloppy * { }"
|
||||
|
||||
compiled_style_sheet = CompiledStyleSheet(css)
|
||||
|
||||
props = compiled_style_sheet.match(Node("mytype"))
|
||||
assert props.get("line-style") is None
|
||||
|
Reference in New Issue
Block a user