Skip to content

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

Closed
hendrikheil wants to merge 1 commit into
nuxt-content:mainfrom
hendrikheil:fix/default-slot-conflict
Closed

fix(document): ignore explicit #default slot markers when comparing content#543
hendrikheil wants to merge 1 commit into
nuxt-content:mainfrom
hendrikheil:fix/default-slot-conflict

Conversation

@hendrikheil

@hendrikheil hendrikheil commented Aug 7, 2026

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.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@hendrikheil is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

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

commit: 9fd227d

@hendrikheil
hendrikheil force-pushed the fix/default-slot-conflict branch from c677a04 to cb047c2 Compare August 7, 2026 08:48
…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.
@hendrikheil
hendrikheil force-pushed the fix/default-slot-conflict branch from cb047c2 to 9fd227d Compare August 7, 2026 08:51
@hendrikheil

Copy link
Copy Markdown
Collaborator Author

Reopened as #544 from a branch on this repository.

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