Merge pull request #2909 from continuedev/pe/fix-apply-bug

bugfix: get codeblocks for pretoolbar
This commit is contained in:
Nate Sesti 2024-11-13 17:01:53 -08:00 • committed by GitHub
commit 6af3c93eab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -136,13 +136,12 @@ function processCodeBlocks(tree: any) {
node.lang = node.lang.split(".").slice(-1)[0];
}
node.data = node.data || {};
node.data.hProperties = node.data.hProperties || {};
node.data.hProperties.codeBlockContent = node.value;
node.data.hProperties.isGeneratingCodeBlock = lastCodeNode === node;
if (node.meta) {
node.data = node.data || {};
node.data.hProperties = node.data.hProperties || {};
node.data.hProperties.isGeneratingCodeBlock = lastCodeNode === node;
node.data.hProperties.codeBlockContent = node.value;
let meta = node.meta.split(" ");
node.data.hProperties.filepath = meta[0];
node.data.hProperties.range = meta[1];