Skip to content

Conversation

@d3m1d0v
Copy link
Member

@d3m1d0v d3m1d0v commented Oct 13, 2025

The problem was when creating a slice inside YFM-Note's or YFM-Cut's content. If includeParents=true is passed, doc.slice() will capture parent note or cut. If you then serialize the slice's content, it will be serialized incorrectly.

// `from` and `to` are inside content of yfm-cut or yfm-note
// includeParents=true
const slice = doc.slice(from, to, true);

// `markup` will contain a closing tag for yfm-cut and/or yfm-note,
// but will be missing an opening tab
const markup = serializer.serialize(slice.content);

console.log(markup); // -->
// 
// <content>
//
// {% endcut %}

This PR fixes this issue.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Visual Tests Report is ready.

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.

3 participants