Skip to content

Skills grid: fix Install/Source click (JSON-in-attribute broke on esc) - #134

Merged
WebTigers merged 1 commit into
mainfrom
fix/skills-entry-attrs
Aug 17, 2026
Merged

Skills grid: fix Install/Source click (JSON-in-attribute broke on esc)#134
WebTigers merged 1 commit into
mainfrom
fix/skills-entry-attrs

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

Symptom

Clicking Install or Source in the skills grid threw:
Uncaught SyntaxError: Expected property name or '}' in JSON at position 1 (at JSON.parse).

Cause

The skill entry was stashed as JSON.stringify({...}) inside a data-entry="..." attribute, escaped with the shared tigerDataTable.esc. But esc() serializes via text→innerHTML, which escapes &<> but not ". The JSON's double quotes closed the attribute early, so getAttribute('data-entry') returned just {JSON.parse failed.

Fix

Carry the entry as individual data-* attributes (source, sourceLabel, name, repo, ref, path, url) and read them back into an object — no JSON in markup, no JSON.parse. Added a local attr() = esc() + "&quot; so any field is genuinely attribute-safe (the general quote-escape gap esc() has).

View-only; deployed to tiger-dev. Install / Source (browse + installed) and the modal-install all work.

🤖 Generated with Claude Code

Clicking Install or Source threw "Uncaught SyntaxError ... JSON at position 1":
the skill entry was stashed as JSON.stringify() in a data-entry attribute via
esc(), but the shared esc() (text→innerHTML) does NOT escape double quotes, so
the JSON's quotes closed the attribute early and getAttribute returned "{".

Carry the entry as individual data-* attrs (source/sourceLabel/name/repo/ref/
path/url) read back into an object — no JSON in markup. Added a local attr()
that adds the missing quote-escape, so any field is attribute-safe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@WebTigers
WebTigers merged commit 72cf2dd into main Aug 17, 2026
13 checks passed
@WebTigers
WebTigers deleted the fix/skills-entry-attrs branch August 17, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant