Skip to content

fix(document): ignore explicit #default slot markers when comparing content - #544

Merged
larbish merged 1 commit into
mainfrom
fix/default-slot-conflict
Aug 18, 2026
Merged

fix(document): ignore explicit #default slot markers when comparing content#544
larbish merged 1 commit into
mainfrom
fix/default-slot-conflict

Conversation

@hendrikheil

Copy link
Copy Markdown
Collaborator

A page whose markdown carries an explicit #default marker is reported as conflicted forever, and the banner blocks the editor before the user can save the normalization that would resolve it. The advice it shows ("ensure your latest changes are deployed and refresh") cannot help — nothing is stale.

@nuxtjs/mdc parses such a file to a byte-identical AST with and without the marker, so the stored body never records it, while comark keeps it when parsing from Git. Only blocks with a sibling slot are affected: comark omits the marker when the default slot is the only one.

Two things I noticed but left alone:

  • Single-line default-slot content still mismatches. comark parses #default plus one text line to a bare string, but the marker-less form wraps it in a p, so unwrapping alone doesn't equalize the trees. The asymmetry is on comark's parse side, so fixing it here felt wrong.
  • comark drops #default's attributes when it is the only slot — the templateCount === 1 early return skips comarkAttributes.

areDocumentsEqual compares two stored documents, so both sides come from the same parser; I left it without this normalization.

…ontent

comark keeps a `#default` marker when parsing a file from Git, while @nuxtjs/mdc
erases it when the website's body is stored. A page written with the marker
therefore never matches the body the site serves, and Studio reports a conflict
no redeploy can clear — the banner blocks the editor before the user can save the
normalization that would resolve it.

Unwrap a leading, attribute-free `#default` template on both sides before
comparing. Elsewhere in the child list the marker is load-bearing, and attributes
carry information of their own.
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
nuxt.studio Ready Ready Preview Aug 10, 2026 9:16am

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2026

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

commit: 9fd227d

@larbish
larbish merged commit d5cd01a into main Aug 18, 2026
7 of 8 checks passed
@larbish
larbish deleted the fix/default-slot-conflict branch August 18, 2026 08:31
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.

2 participants