Files
misskey/src/server/api/common/text/elements/bold.ts
2018-03-29 01:54:41 +09:00

15 lines
229 B
TypeScript

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