implement syntax: hashtag

This commit is contained in:
marihachi 2020-03-01 16:26:43 +09:00
parent 5e275d3a2d
commit 34d0a7485f

View file

@ -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