Add new text syntax

And some fixes
This commit is contained in:
syuilo 2018-04-19 15:05:39 +09:00
parent f6a041559f
commit 7a270275ef
6 changed files with 56 additions and 2 deletions

View 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)
};
};