1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-28 14:58:24 +09:00

Update parser.ts (#3999)

* Update parser.ts

* Update parser.ts

* Update parser.ts
This commit is contained in:
Acid Chicken (硫酸鶏) 2019-01-27 13:50:47 +09:00 committed by syuilo
parent 71210595d2
commit 54ce19bd56

View File

@ -358,10 +358,9 @@ const mfm = P.createLanguage({
title: r => title: r =>
newline.then(P((input, i) => { newline.then(P((input, i) => {
const text = input.substr(i); const text = input.substr(i);
const match = text.match(/^((【|\[)(.+?)(】|]))(\n|$)/); const match = text.match(/^([【\[]([^【\[】\]\n]+?)[】\]])(\n|$)/);
if (!match) return P.makeFailure(i, 'not a title'); if (!match) return P.makeFailure(i, 'not a title');
const q = match[1].trim().substring(1, match[1].length - 1); const q = match[2].trim();
if (q.includes('】')) return P.makeFailure(i, 'not a title');
const contents = P.alt( const contents = P.alt(
r.big, r.big,
r.small, r.small,