This commit is contained in:
syuilo 2018-02-27 12:32:01 +09:00
parent d24bb24c6e
commit 68dd705500
5 changed files with 77 additions and 15 deletions

View file

@ -0,0 +1,14 @@
/**
* Quoted text
*/
module.exports = text => {
const match = text.match(/^"([\s\S]+?)\n"/);
if (!match) return null;
const quote = match[0];
return {
type: 'quote',
content: quote,
quote: quote.substr(1, quote.length - 2).trim(),
};
};