mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-19 08:27:35 -07:00
17 lines
301 B
JavaScript
17 lines
301 B
JavaScript
/**
|
|
* Bold
|
|
*/
|
|
|
|
const regexp = /\*\*(.+?)\*\*/;
|
|
|
|
module.exports = {
|
|
test: x => new RegExp('^' + regexp.source).test(x),
|
|
parse: text => {
|
|
const bold = text.match(new RegExp('^' + regexp.source))[0];
|
|
return {
|
|
type: 'bold',
|
|
content: bold,
|
|
bold: bold.substr(2, bold.length - 4)
|
|
};
|
|
}
|
|
};
|