1
0
Files
pawkey-sk/src/server/api/common/text/elements/quote.ts
T
2018-03-29 01:54:41 +09:00

15 lines
251 B
TypeScript

/**
* 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(),
};
};