import ast import pathlib import re import subprocess import tempfile text = pathlib.Path(r"F:/AI/guest-cs-stack/flask/chatwoot_proxy.py").read_text(encoding="utf-8") mod = ast.parse(text) found = None for node in ast.walk(mod): if isinstance(node, ast.Constant) and isinstance(node.value, str) and "polishQuickQuestions" in node.value: found = node.value break # strip script tags, keep JS js = found js = re.sub(r"]*>", "\n", js, flags=re.I) # remove style blocks if any js = re.sub(r"", "\n", js, flags=re.I) # remove remaining HTML-ish lines starting with < lines = [] for line in js.splitlines(): s = line.strip() if s.startswith("<") and not s.startswith(">" if i + 1 == ln else " " print(f"{mark}{i+1}: {all_lines[i]}")