summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-11-07 21:17:27 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-11-07 21:17:27 +0900
commit4c81e400c495c22f3609448dadc513ea6134178a (patch)
tree8811c18b7b4db05405ddc27cebd287f9759183b2
parent10.44.2 (diff)
downloadsharkey-4c81e400c495c22f3609448dadc513ea6134178a.tar.gz
sharkey-4c81e400c495c22f3609448dadc513ea6134178a.tar.bz2
sharkey-4c81e400c495c22f3609448dadc513ea6134178a.zip
[MFM] Fix title parsing
-rw-r--r--src/mfm/parse/elements/title.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mfm/parse/elements/title.ts b/src/mfm/parse/elements/title.ts
index c91ed86e69..d67236aa78 100644
--- a/src/mfm/parse/elements/title.ts
+++ b/src/mfm/parse/elements/title.ts
@@ -11,10 +11,9 @@ export type TextElementTitle = {
export default function(text: string, isBegin: boolean) {
const match = isBegin ? text.match(/^(【|\[)(.+?)(】|])\n/) : text.match(/^\n(【|\[)(.+?)(】|])\n/);
if (!match) return null;
- const title = match[0];
return {
type: 'title',
- content: title,
- title: title.substr(1, title.length - 3)
+ content: match[0],
+ title: match[2]
} as TextElementTitle;
}