diff --git a/src/parser.pegjs b/src/parser.pegjs index 5eeaccf196db13cf5d9e7f0ed7412cf2437ae844..cd86eec1579462c23f8a4b862b6d94c31daea9cf 100644 --- a/src/parser.pegjs +++ b/src/parser.pegjs @@ -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)