Change italic syntax to fit with other markdown implementations (#3916)
currently italics require an html <i> syntax, unlike every other formatter. this is very confusing, especially as there doesnt seem to be any documentation. this change makes both _text_ and *text* work, both things that users would expect from other implementations of markdown such as pleroma, discord and github. Add test
This commit is contained in:
parent
11689e6d18
commit
361af34956
2 changed files with 38 additions and 7 deletions
|
@ -224,7 +224,7 @@ const mfm = P.createLanguage({
|
|||
|
||||
//#region Italic
|
||||
italic: r =>
|
||||
P.regexp(/<i>([\s\S]+?)<\/i>/, 1)
|
||||
P.regexp(/(\*|_)([a-zA-Z0-9]+?[\s\S]*?)\1/, 2)
|
||||
.map(x => createTree('italic', P.alt(
|
||||
r.bold,
|
||||
r.strike,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue