mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-22 05:55:13 +00:00
Resolve #64
This commit is contained in:
parent
646ea18508
commit
b0a91ceec2
2 changed files with 9 additions and 4 deletions
|
@ -401,13 +401,14 @@ link
|
||||||
linkLabel
|
linkLabel
|
||||||
= parts:linkLabelPart+
|
= parts:linkLabelPart+
|
||||||
{
|
{
|
||||||
return parts;
|
return parts.flat();
|
||||||
}
|
}
|
||||||
|
|
||||||
linkLabelPart
|
linkLabelPart
|
||||||
= url { return text(); /* text node */ }
|
= "[" linkLabelPart* "]" linkLabelPart* &("](" url:linkUrl ")")
|
||||||
/ link { return text(); /* text node */ }
|
{ return applyParser(text(), 'inlineParser'); }
|
||||||
/ !"]" n:inline { return n; }
|
/ !"]" n:plain
|
||||||
|
{ return n; }
|
||||||
|
|
||||||
linkUrl
|
linkUrl
|
||||||
= url { return text(); }
|
= url { return text(); }
|
||||||
|
|
|
@ -19,6 +19,10 @@ export function mergeText(nodes: (MfmNode | string)[]): MfmNode[] {
|
||||||
// Store the char.
|
// Store the char.
|
||||||
storedChars.push(node);
|
storedChars.push(node);
|
||||||
}
|
}
|
||||||
|
else if (node.type == 'text') {
|
||||||
|
// Store the text.
|
||||||
|
storedChars.push(node.props.text);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
generateText();
|
generateText();
|
||||||
dest.push(node);
|
dest.push(node);
|
||||||
|
|
Loading…
Reference in a new issue