blob: 51706f89ff1014875baee0ad183178dd2038b7d2 [file] [log] [blame]
function removeCodeAndComment(body) {
return body
.replace(/<!--[\w\W\s]*?-->/gmi, '')
.replace(/`{3}(.|\n)*`{3}/gmi, '')
.replace(/#.*\s?/g, '')
.replace(/-{3}\s?/g, '');
}
function removeHTMLComment (body) {
return body.replace(/<!--[\w\W\s]*?-->/gmi, '');
}
function replaceAll(str, search, replacement) {
return str.replace(new RegExp(search, 'g'), replacement);
}
module.exports = {
removeCodeAndComment,
removeHTMLComment,
replaceAll
};