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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user