Skip to content

[6.x] Fix HTML getting encoded when pasting a copied Bard set - #15718

Open
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/bard-set-paste-encoding
Open

mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/bard-set-paste-encoding

Conversation

@mynetx

@mynetx mynetx commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Copying a Bard set and pasting it pastes the set with its values HTML-encoded. A text or code field containing <b>bold</b> & co comes back as &lt;b&gt;bold&lt;/b&gt; &amp; co.

A copied set is written to the clipboard as <bard-set> with its attributes as JSON text, so the browser entity-encodes <, > and & in the clipboard HTML. When pasting, the set was read back with innerHTML, which keeps those entities. textContent gives back the original JSON.

Before After
11958-before 11958-after

Fixes #11958

🤖 Generated with Claude Code

A copied set is written to the clipboard with its values as JSON text, so
characters like < and & are entity-encoded. Reading it back from innerHTML
kept them encoded, so a pasted set's values came back as &lt;b&gt; etc.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Characters get encoded when copying a set with html

1 participant