Repository navigation
added html editor + url generator, new instructions syntax, compression - #1
Merged
Merged
Conversation
- Replace URL-param DSL with line-based instruction format (E=element, A=attribute, T=text, ^=pop) for readability and better compression - Add deflate-raw compression via CompressionStream + base64url encoding for compact URL fragments - Extract shared logic into dombuilder.js (instruction executor, HTML-to-instructions converter, compress/decompress, base64url) - Add editor.html: W3Schools-style try-it editor with HTML source textarea, live preview iframe, and generated URL output https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
midlan
had a problem deploying
to
github-pages
February 18, 2026 00:56 — with
GitHub Actions
Failure
Each tag gets its own subdirectory on the gh-pages branch, e.g. https://midlan.github.io/dombuilder/v1/editor.html. Avoids environment protection rules by pushing to gh-pages branch instead of using Actions-based deployment. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
- Remove index.html from generated URLs so they look like /tag/#hash - Add Copy button next to the URL bar in editor - Rewrite README with editor docs and "How It Works" section https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
- Escape newlines and backslashes in attribute values when encoding A instructions, matching the escaping already done for T instructions. Unescaped newlines in attr values would corrupt the line-based instruction stream. - Decode escape sequences when reading A instruction values. - Preserve whitespace-only text nodes (e.g. space between inline elements) by checking text !== '' instead of text.trim() !== ''. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Test HTML examples: form, table, inline SVG, inline CSS, inline JS. The test script reads each file, compresses it via encodeInstructions, decompresses via decodeInstructions, and asserts the output matches the original input. GitHub Actions workflow runs the tests on every push and PR. Tests dir is already excluded from gh-pages (deploy copies only specific files). https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Move appendChild from the E instruction to the ^ instruction so elements are completely constructed (attributes, text, children) before being inserted into the live DOM. This fixes inline <script> execution — previously the empty script was appended first, causing the browser to set the "already started" flag before any text content was added, silently preventing execution. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Check parent namespaceURI to detect SVG context and use createElementNS for svg and its descendants. The root svg element is matched by tag name; children inherit the namespace from their parent. Without this, SVG elements were created in the HTML namespace and silently failed to render. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Each deploy now copies files into a /latest/ directory alongside the versioned directory, so /latest/ always points to the most recent tag. The root index lists "latest" first with the actual tag name. README example link updated to use /latest/. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Add .nojekyll to disable Jekyll processing so GitHub Pages serves symlinks as-is. Replace the latest/ directory copy with a real symlink pointing at the current tag directory. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Guard the latest symlink update with a regex check so only tags matching ^v[0-9] update it. Test or ad-hoc tags still deploy to their own directory but won't overwrite the latest pointer. Updated README examples to use v1/v2 instead of test1. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
- sed the tag into <title> of index.html and editor.html during deploy so the browser tab shows which version is loaded. - Remove tag name from the "latest" link in the root index — it just says "latest" now. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
- Match only exactly v<digits> (^v[0-9]+$) so tags like v3-test1 don't update latest. - If no latest symlink exists yet, any tag creates it so there's always a working latest link. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Add DEPLOY_TAG constant to editor.html (null for local dev). At deploy time, the workflow seds it to the actual tag. When set, the generated DOM URL rewrites the path segment to the real version, so visitors using /latest/editor.html get /v3/#data links, not /latest/#data. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
The old check (! -e _site/latest) only worked for the very first deploy. Once test3 created latest, test4 couldn't overwrite it. Now checks if latest currently points to a real version tag (v1, v2…). If it doesn't (pointing to a test tag or missing), any tag can update it. Once a real version is deployed, only version tags update latest. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
- Increase dombuilder link font size in editor toolbar - Add play triangle to Run button - Lowercase "dombuilder" on releases page with "Releases" subheading https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
htmlToInstructions was unconditionally lowercasing all tagName values. HTML elements need this (DIV -> div) but SVG elements like clipPath, foreignObject, linearGradient, textPath and fe* filters have camelCase names that must be preserved, otherwise createElementNS produces elements with wrong local names that don't render. https://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
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.
Summary
This PR introduces DomBuilder, a system for compressing HTML into a compact instruction format, compressing it with deflate, and encoding it as base64url for use in URL hashes. It includes both a decoder for rendering compressed HTML and an editor for creating and sharing compressed HTML URLs.
Key Changes
New
dombuilder.jsmodule: Core library providing:Simplified
index.html: Replaced complex URL parameter parsing with:decodeInstructions()andexecuteInstructions()to render the DOMNew
editor.html: Interactive editor for creating shareable URLs:Implementation Details
E tag,A name value,T text,^(pop)\\for backslash,\nfor newlinehttps://claude.ai/code/session_01CAZxB9pJJmC3nph4AjqG4s
Note
Medium Risk
Medium risk because it replaces the URL parsing/rendering mechanism and adds a custom compression/encoding pipeline plus new deployment automation, which could break existing links or Pages publishing if assumptions are wrong.
Overview
Switches the app from query-style hash parsing to a compressed instruction format stored in the URL hash, with
index.htmlnow decoding and executing instructions to rebuild the DOM at runtime.Adds a new
dombuilder.jscore module (instruction executor, HTML→instruction conversion, deflate-raw compression, base64url encode/decode) and aneditor.htmlsplit-panel editor that generates shareable URLs and previews output.Updates GitHub Actions to deploy on tags into per-tag directories on
gh-pages, maintain a/latest/symlink, and generate a root release index; adds a Node 20 CI workflow that roundtrips encode/decode against example HTML fixtures. UpdatesREADME.mdto document the new editor, encoding approach, and versioned deployments.Written by Cursor Bugbot for commit 798ee9e. This will update automatically on new commits. Configure here.