Refactoring
This commit is contained in:
parent
30f0b1c30d
commit
2e22874dec
4 changed files with 8 additions and 8 deletions
|
|
@ -8,8 +8,8 @@ export type TextElementTitle = {
|
|||
title: string;
|
||||
};
|
||||
|
||||
export default function(text: string, i: number) {
|
||||
const match = i == 0 ? text.match(/^(【|\[)(.+?)(】|])\n/) : text.match(/^\n(【|\[)(.+?)(】|])\n/);
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue