diff --git a/graphify/exporters/html.py b/graphify/exporters/html.py index 14f781249..1fbe8eb10 100644 --- a/graphify/exporters/html.py +++ b/graphify/exporters/html.py @@ -613,9 +613,13 @@ def to_html( n = member_counts.get(cid, len(communities.get(cid, []))) if member_counts else len(communities.get(cid, [])) legend_data.append({"cid": cid, "color": color, "label": lbl, "count": n}) - # Escape sequences so embedded JSON cannot break out of the script tag + # Escape every `<` as < so embedded JSON cannot break out of the ` no longer closes the tag and the page goes + # blank (#4124). `<` round-trips through JSON.parse, so labels render unchanged. def _js_safe(obj) -> str: - return json.dumps(obj).replace(" str: - # Escape sequences so embedded JSON cannot break out of the - #