MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _strip_css

Function _strip_css

scripts/theme_gate.py:224–229  ·  view source on GitHub ↗

Blank CSS comments, strings and Liquid spans, keeping newlines.

(text: str)

Source from the content-addressed store, hash-verified

222
223
224def _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
232def css_selectors(text: str) -> list[tuple[int, str]]:

Callers 1

css_selectorsFunction · 0.85

Calls 3

_blankFunction · 0.70
startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected