diff options
| author | ibrokemypie <ibrokemypie@bastardi.net> | 2019-01-20 19:44:52 +1100 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-01-20 17:44:52 +0900 |
| commit | 361af34956f611b9ccb1fd6cbca8d6df7fb85d57 (patch) | |
| tree | a0fc8a27ef988f5f3b41de8909343f4b1edef2bd /src | |
| parent | Better version format (diff) | |
| download | sharkey-361af34956f611b9ccb1fd6cbca8d6df7fb85d57.tar.gz sharkey-361af34956f611b9ccb1fd6cbca8d6df7fb85d57.tar.bz2 sharkey-361af34956f611b9ccb1fd6cbca8d6df7fb85d57.zip | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/mfm/parser.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mfm/parser.ts b/src/mfm/parser.ts index 7dc97aa9f4..f377d18611 100644 --- a/src/mfm/parser.ts +++ b/src/mfm/parser.ts @@ -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, |