summaryrefslogtreecommitdiff
path: root/src/api/common/text/elements/bold.ts
blob: ce257644579aef05263a2c87a49b3c389c01ce04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * 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)
	};
};