Blank CSS comments, strings and Liquid spans, keeping newlines.
(text: str)
| 222 | |
| 223 | |
| 224 | def _strip_css(text: str) -> str: |
| 225 | """Blank CSS comments, strings and Liquid spans, keeping newlines.""" |
| 226 | out = list(text) |
| 227 | for m in re.finditer(r"/\*.*?\*/|\"(?:[^\"\\\n]|\\.)*\"|'(?:[^'\\\n]|\\.)*'|\{\{.*?\}\}|\{%.*?%\}", text, re.S): |
| 228 | _blank(text, m.start(), m.end(), out) |
| 229 | return "".join(out) |
| 230 | |
| 231 | |
| 232 | def css_selectors(text: str) -> list[tuple[int, str]]: |
no test coverage detected