mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 17:35:40 +02:00
Add new text syntax
And some fixes
This commit is contained in:
14
src/text/parse/elements/title.ts
Normal file
14
src/text/parse/elements/title.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Title
|
||||
*/
|
||||
|
||||
module.exports = text => {
|
||||
const match = text.match(/^【(.+?)】\n/);
|
||||
if (!match) return null;
|
||||
const title = match[0];
|
||||
return {
|
||||
type: 'title',
|
||||
content: title,
|
||||
title: title.substr(1, title.length - 3)
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user