mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-01 15:45:58 +09:00
Improve MFM
This commit is contained in:
parent
8f5f3985f4
commit
79c7712241
@ -63,6 +63,7 @@ const mfm = P.createLanguage({
|
|||||||
P.regexp(/^\*\*\*([\s\S]+?)\*\*\*/, 1)
|
P.regexp(/^\*\*\*([\s\S]+?)\*\*\*/, 1)
|
||||||
.map(x => makeNodeWithChildren('big', P.alt(
|
.map(x => makeNodeWithChildren('big', P.alt(
|
||||||
r.mention,
|
r.mention,
|
||||||
|
r.hashtag,
|
||||||
r.emoji,
|
r.emoji,
|
||||||
r.text
|
r.text
|
||||||
).atLeast(1).tryParse(x))),
|
).atLeast(1).tryParse(x))),
|
||||||
@ -85,6 +86,7 @@ const mfm = P.createLanguage({
|
|||||||
P.regexp(/\*\*([\s\S]+?)\*\*/, 1)
|
P.regexp(/\*\*([\s\S]+?)\*\*/, 1)
|
||||||
.map(x => makeNodeWithChildren('bold', P.alt(
|
.map(x => makeNodeWithChildren('bold', P.alt(
|
||||||
r.mention,
|
r.mention,
|
||||||
|
r.hashtag,
|
||||||
r.emoji,
|
r.emoji,
|
||||||
r.text
|
r.text
|
||||||
).atLeast(1).tryParse(x))),
|
).atLeast(1).tryParse(x))),
|
||||||
@ -176,6 +178,7 @@ const mfm = P.createLanguage({
|
|||||||
.map(x => makeNodeWithChildren('motion', P.alt(
|
.map(x => makeNodeWithChildren('motion', P.alt(
|
||||||
r.bold,
|
r.bold,
|
||||||
r.mention,
|
r.mention,
|
||||||
|
r.hashtag,
|
||||||
r.emoji,
|
r.emoji,
|
||||||
r.text
|
r.text
|
||||||
).atLeast(1).tryParse(x))),
|
).atLeast(1).tryParse(x))),
|
||||||
|
Loading…
Reference in New Issue
Block a user