mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-22 05:55:13 +00:00
implement syntax: hashtag
This commit is contained in:
parent
5e275d3a2d
commit
34d0a7485f
1 changed files with 21 additions and 1 deletions
|
@ -42,7 +42,7 @@ inline
|
|||
/ inlineCode
|
||||
/ mathInline
|
||||
// / mention
|
||||
// / hashtag
|
||||
/ hashtag
|
||||
// / url
|
||||
// / link
|
||||
/ customEmoji
|
||||
|
@ -253,6 +253,26 @@ mathInline
|
|||
}
|
||||
|
||||
|
||||
// inline: hashtag
|
||||
|
||||
hashtag
|
||||
= "#" content:hashtag_content
|
||||
{
|
||||
return createTree('hashtag', { hashtag: content });
|
||||
}
|
||||
|
||||
hashtag_content
|
||||
= (![\s!"#$%&'*+,\-./:;<=>?@\\^_`{|}~【】<>] (hashtag_bracket / hashtag_char))+ { return text(); }
|
||||
|
||||
hashtag_bracket
|
||||
= "(" hashtag_content* ")"
|
||||
/ "[" hashtag_content* "]"
|
||||
/ "「" hashtag_content* "」"
|
||||
|
||||
hashtag_char
|
||||
= ![()\[\]「」] CHAR
|
||||
|
||||
|
||||
// inline: custom emoji
|
||||
|
||||
customEmoji
|
||||
|
|
Loading…
Reference in a new issue