fix(editor): preserve button href through HTML round-trip#3217
fix(editor): preserve button href through HTML round-trip#3217bukinoshita merged 2 commits intocanaryfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
commit: |
|
@cursor can you fix conflicts please? |
|
Conflicts resolved. I rebased the branch onto the latest |
The button extension was serializing href only as data-href in renderHTML, and parseHTML never mapped data-href back to href. This caused buttons to lose their link (falling back to '#') after any HTML round-trip (getHTML -> setContent, copy/paste, persist/reload). Changes: - renderHTML: emit both href and data-href attributes on the <a> tag - parseHTML: map data-href back to href when building node attributes - Add tests for full round-trip and data-href-only parsing Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
c9b1ae6 to
2288f5e
Compare
Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>


Summary
The button extension serializes href into a data-href attribute in renderHTML but never maps it back during parseHTML. This means any HTML round-trip (e.g. getHTML() → setContent(), copy/paste, or persist/reload) causes the button's link to be lost, falling back to the default #.