fix(wiki): use group(1) for script extraction; use link button for topology

The wiki_update_page.py script had a bug where extract_script_to_script_js
used match.group(0) (including <script> tags) instead of group(1) (pure JS).
This caused Wiki.js to render page JS as escaped HTML text rather than
executing it.

Since Wiki.js markdown editor strips iframes and only the markdown editor
is enabled, the topology diagram is now linked via a prominent button that
opens the interactive topology viewer in a new tab.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-13 17:06:33 +08:00
co-authored by Claude
parent e8e2f99450
commit ac2578ca8b
2 changed files with 13 additions and 8 deletions
+1 -1
View File
@@ -328,7 +328,7 @@ def extract_script_to_script_js(content):
if not match:
print("script_js_extracted=False")
return content, ""
script_js = match.group(0).strip()
script_js = match.group(1).strip()
content_without_script = (content[: match.start()] + content[match.end() :]).rstrip()
print(f"script_js_extracted=True length={len(script_js)}")
return content_without_script, script_js