Issue #62: fix selector escaping.

This commit is contained in:
Sergey Vartanov 2021-07-24 20:01:08 +03:00
parent eae7f706f2
commit e284e34c72
2 changed files with 3 additions and 7 deletions

View file

@ -168,7 +168,9 @@ class NodeMatcher(Matcher):
"""Get MapCSS 0.2 selector for one key."""
if value == "*":
return f"[{key}]"
return f"[{key}={value}]"
if '"' in value:
return f"[{key}='{value}']"
return f'[{key}="{value}"]'
return "".join([get_selector(x, y) for (x, y) in self.tags.items()])