mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 14:07:38 -07:00
[MFM] Fix title parsing
This commit is contained in:
parent
83d96eede1
commit
2650eca7a1
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue