Skip to content

fix(tiptap): match camelCase meta props to kebab-cased stored attrs#531

Merged
hendrikheil merged 1 commit into
mainfrom
worktree-idempotent-wishing-feather
Jul 7, 2026
Merged

fix(tiptap): match camelCase meta props to kebab-cased stored attrs#531
hendrikheil merged 1 commit into
mainfrom
worktree-idempotent-wishing-feather

Conversation

@hendrikheil

@hendrikheil hendrikheil commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #529 - Studio was corrupting MDC component props (duplicate fields in the props editor, values silently dropped/rewritten).

Root cause: the MDC parser stores component props in kebab-case (e.g. cite-name), while nuxt-component-meta declares them in camelCase (e.g. citeName). buildFormTreeFromProps in src/app/src/utils/tiptap/props.ts matched these with exact string equality:

  • The meta-declared field's value lookup never found the kebab-cased stored value → rendered empty.
  • The stored kebab-cased key wasn't recognized as already covered by the meta field → added again as a duplicate "custom" field.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
content-studio Ready Ready Preview, Comment Jul 3, 2026 8:48am
nuxt.studio Ready Ready Preview Jul 3, 2026 8:48am

@pkg-pr-new

pkg-pr-new Bot commented Jul 3, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/nuxt-studio@531

commit: 1ff4c70

Stored node attrs may use whatever casing the source markdown/parser
produced, while nuxt-component-meta always declares props in
camelCase, so compare both forms via kebabCase to bind a component's
declared prop to its stored value regardless of casing.
@hendrikheil hendrikheil force-pushed the worktree-idempotent-wishing-feather branch from b49cb66 to 1ff4c70 Compare July 3, 2026 08:43
@hendrikheil hendrikheil marked this pull request as ready for review July 3, 2026 08:47
@hendrikheil hendrikheil merged commit eff5a6b into main Jul 7, 2026
6 checks passed
@hendrikheil hendrikheil deleted the worktree-idempotent-wishing-feather branch July 7, 2026 08:09
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.

Studio alters props and breaks them

1 participant