mit-license/routes/utils.js
Remy Sharp d5636b1004 feat: move to vanilla js + (my) lints
Largly just a code reorg taking all of @Richienb's work and splitting it
into separate files.
2019-06-19 18:10:40 +01:00

7 lines
207 B
JavaScript

const tags = {
'<': '&lt;',
'>': '&gt;',
'&': '&amp;',
};
exports.escapeTags = str => (str || '').replace(/[<>&]/g, m => tags[m]);
exports.stripTags = str => (str || '').replace(/<(?:.|\n)*?>/gm, '');