mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-25 07:25:13 +00:00
improve detection of mention, hashtag, italic(alt)
This commit is contained in:
parent
64d0429bb6
commit
e0f78290ef
1 changed files with 3 additions and 3 deletions
|
@ -285,12 +285,12 @@ italicTag
|
|||
}
|
||||
|
||||
italicAlt
|
||||
= "*" content:$(!"*" ([a-z0-9]i / _))+ "*" &(EOF / LF / _)
|
||||
= "*" content:$(!"*" ([a-z0-9]i / _))+ "*" &(EOF / LF / _ / ![a-z0-9]i)
|
||||
{
|
||||
const parsedContent = applyParser(content, 'inlineParser');
|
||||
return ITALIC(parsedContent);
|
||||
}
|
||||
/ "_" content:$(!"_" ([a-z0-9]i / _))+ "_" &(EOF / LF / _)
|
||||
/ "_" content:$(!"_" ([a-z0-9]i / _))+ "_" &(EOF / LF / _ / ![a-z0-9]i)
|
||||
{
|
||||
const parsedContent = applyParser(content, 'inlineParser');
|
||||
return ITALIC(parsedContent);
|
||||
|
@ -476,7 +476,7 @@ fnContentPart
|
|||
// inline: text
|
||||
|
||||
inlineText
|
||||
= !(LF / _) . &(hashtag / mention / italicAlt) . { return text(); } // hashtag, mention, italic ignore
|
||||
= !(LF / _) [a-z0-9]i &(hashtag / mention / italicAlt) . { return text(); } // hashtag, mention, italic ignore
|
||||
/ . /* text node */
|
||||
|
||||
// inline: text (for plainParser)
|
||||
|
|
Loading…
Reference in a new issue