support code blocks with multiple text nodes
This commit is contained in:
parent
bbf165d3b0
commit
99673ee3cc
@ -435,7 +435,9 @@ function convertNode(node, children, shortcodePlugins) {
|
||||
* value and the "lang" data property to the new MDAST node.
|
||||
*/
|
||||
case 'code': {
|
||||
const value = get(node.nodes, [0, 'text']);
|
||||
const value = flatMap(node.nodes, child => {
|
||||
return flatMap(child.ranges, 'text');
|
||||
}).join('');
|
||||
const { lang, ...data } = get(node, 'data', {});
|
||||
return u(typeMap[node.type], { lang, data }, value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user