summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mfm/parser.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mfm/parser.ts b/src/mfm/parser.ts
index 5572e26f88..560e226af9 100644
--- a/src/mfm/parser.ts
+++ b/src/mfm/parser.ts
@@ -358,10 +358,9 @@ const mfm = P.createLanguage({
title: r =>
newline.then(P((input, 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');
- const q = match[1].trim().substring(1, match[1].length - 1);
- if (q.includes('】')) return P.makeFailure(i, 'not a title');
+ const q = match[2].trim();
const contents = P.alt(
r.big,
r.small,