fix(document): ignore explicit #default slot markers when comparing content - #544
Merged
Conversation
…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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
larbish
approved these changes
Aug 18, 2026
This was referenced Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A page whose markdown carries an explicit
#defaultmarker 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/mdcparses 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:
#defaultplus one text line to a bare string, but the marker-less form wraps it in ap, so unwrapping alone doesn't equalize the trees. The asymmetry is on comark's parse side, so fixing it here felt wrong.#default's attributes when it is the only slot — thetemplateCount === 1early return skipscomarkAttributes.areDocumentsEqualcompares two stored documents, so both sides come from the same parser; I left it without this normalization.