This commit is contained in:
marihachi 2021-06-26 22:18:18 +09:00
parent 646ea18508
commit b0a91ceec2
2 changed files with 9 additions and 4 deletions

View file

@ -401,13 +401,14 @@ link
linkLabel
= parts:linkLabelPart+
{
return parts;
return parts.flat();
}
linkLabelPart
= url { return text(); /* text node */ }
/ link { return text(); /* text node */ }
/ !"]" n:inline { return n; }
= "[" linkLabelPart* "]" linkLabelPart* &("](" url:linkUrl ")")
{ return applyParser(text(), 'inlineParser'); }
/ !"]" n:plain
{ return n; }
linkUrl
= url { return text(); }

View file

@ -19,6 +19,10 @@ export function mergeText(nodes: (MfmNode | string)[]): MfmNode[] {
// Store the char.
storedChars.push(node);
}
else if (node.type == 'text') {
// Store the text.
storedChars.push(node.props.text);
}
else {
generateText();
dest.push(node);