Parses the url in the link node as text node.

This commit is contained in:
marihachi 2021-04-03 15:03:58 +09:00
parent 5ab1b26171
commit 7af351f965

View file

@ -333,7 +333,7 @@ urlBracketPair
// inline: link
link
= silent:"?"? "[" label:linkLabel "](" url:linkUrl ")"
= silent:"?"? "[" label:linkLabelPart+ "](" url:linkUrl ")"
{
return createNode('link', {
silent: (silent != null),
@ -341,8 +341,9 @@ link
}, mergeText(label));
}
linkLabel
= (!"]" n:inline { return n; })+
linkLabelPart
= url { return text(); /* text node */ }
/ !"]" n:inline { return n; }
linkUrl
= url { return text(); }
@ -382,7 +383,7 @@ fnArg
// inline: text
text
= .
= . /* text node */
//
// General