Repository navigation
Fix inline transcript script parse errors killing all UI features - #1
Merged
Merged
Conversation
Two syntax errors in the embedded transcript.js caused the entire inline script to be discarded at parse time, disabling the theme toggle, download menu, spoilers, profile cards, and lightbox: - Regex literal used double-escaped forward slashes (\\/), which terminated the regex early and produced invalid flags - The wrapping IIFE was never closed with })(); Bump RendererVersion to 11 so RefreshStoredHTML re-renders stored bundles from their saved transcript.json on next startup. Add TestEmbeddedScriptIsWellFormed to pin the structural checks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On rendered transcript pages, the theme toggle, download menu, and all other interactive features did nothing when clicked.
Root cause
The embedded
transcript.jshad two syntax errors that discarded the entire inline<script>block at parse time, so no event listeners were ever attached:/^(?:https:\\\/\\/|\\/)/. In regex syntax\\matches a literal backslash, so the following/terminated the regex early →Invalid regular expression flags.(function () {but was never closed with})();.Fix
/^(?:https:\/|\/)/RendererVersion10 → 11 so the existing startup migration (RefreshStoredHTML) re-renders already-stored transcript bundles from their savedtranscript.json— no Discord credentials neededTestEmbeddedScriptIsWellFormedregression test (no\\/sequences, IIFE open/close, balanced braces)Verification
node --check internal/render/transcript.jspassesgo build ./... && go test ./internal/...all passrefreshed:1, and the stored bundle'sindex.htmlnow contains neither bug; registry records version 11