mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-17 06:45:36 +02:00
[noImplicitAny: true] src/text
This commit is contained in:
@@ -2,7 +2,13 @@
|
||||
* Title
|
||||
*/
|
||||
|
||||
module.exports = text => {
|
||||
export type TextElementTitle = {
|
||||
type: "title"
|
||||
content: string
|
||||
title: string
|
||||
};
|
||||
|
||||
export default function(text: string) {
|
||||
const match = text.match(/^【(.+?)】\n/);
|
||||
if (!match) return null;
|
||||
const title = match[0];
|
||||
@@ -10,5 +16,5 @@ module.exports = text => {
|
||||
type: 'title',
|
||||
content: title,
|
||||
title: title.substr(1, title.length - 3)
|
||||
};
|
||||
};
|
||||
} as TextElementTitle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user