Sharkey/src/api/common/text/elements/bold.ts

15 lines
229 B
TypeScript
Raw Normal View History

2016-12-29 00:49:51 +02:00
/**
* Bold
*/
2017-02-10 19:32:00 +02:00
module.exports = text => {
const match = text.match(/^\*\*(.+?)\*\*/);
if (!match) return null;
const bold = match[0];
return {
type: 'bold',
content: bold,
bold: bold.substr(2, bold.length - 4)
};
2016-12-29 00:49:51 +02:00
};