mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-25 07:25:13 +00:00
implement link
This commit is contained in:
parent
18ca201a77
commit
c1eb9eed76
1 changed files with 18 additions and 0 deletions
|
@ -157,6 +157,7 @@ inline
|
|||
/ mathInline
|
||||
/ hashtag
|
||||
/ url
|
||||
/ link
|
||||
/ text
|
||||
|
||||
// inline: emoji
|
||||
|
@ -307,6 +308,23 @@ urlBracketPair
|
|||
= "(" urlContentPart* ")"
|
||||
/ "[" urlContentPart* "]"
|
||||
|
||||
// inline: link
|
||||
|
||||
link
|
||||
= silent:"?"? "[" label:linkLabel "](" url:$(url) ")"
|
||||
{
|
||||
return createNode('link', {
|
||||
silent: (silent != null),
|
||||
url: url
|
||||
}, mergeText(label));
|
||||
}
|
||||
|
||||
linkLabel
|
||||
= (!"]" n:inline { return n; })+
|
||||
|
||||
linkUrl
|
||||
= url { return text(); }
|
||||
|
||||
// inline: text
|
||||
|
||||
text
|
||||
|
|
Loading…
Reference in a new issue