Skip to content
Snippets Groups Projects
Commit d08b0dcb authored by marihachi's avatar marihachi
Browse files

fix italic syntax

parent 5ff959c7
No related branches found
No related tags found
No related merge requests found
......@@ -219,16 +219,22 @@ small
// inline: italic
italic
= italicTag
/ italicAlt
italicTag
= "<i>" content:(!"</i>" i:inline { return i; })+ "</i>"
{
return ITALIC(mergeText(content));
}
/ "*" content:$(!"*" ([a-z0-9]i / _))+ "*"
italicAlt
= "*" content:$(!"*" ([a-z0-9]i / _))+ "*" &(LF / _)
{
const parsedContent = applyParser(content, 'inlineParser');
return ITALIC(parsedContent);
}
/ "_" content:$(!"_" ([a-z0-9]i / _))+ "_"
/ "_" content:$(!"_" ([a-z0-9]i / _))+ "_" &(LF / _)
{
const parsedContent = applyParser(content, 'inlineParser');
return ITALIC(parsedContent);
......@@ -383,7 +389,7 @@ fnArg
// inline: text
inlineText
= !(LF / _) . &(hashtag / mention) . { return text(); } // hashtag, mention ignore
= !(LF / _) . &(hashtag / mention / italicAlt) . { return text(); } // hashtag, mention, italic ignore
/ . /* text node */
// inline: text (for plainParser)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment