epubinator
Version:
NPM package to generate epub files out of url
26 lines (25 loc) • 585 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripHtmlAttributes = exports.stripNbsp = void 0;
/**
* stripNbsp
*
* @param {string} html
* @returns {string}
*/
function stripNbsp(html) {
var nbspRegex = / /gi;
return html.replace(nbspRegex, ' ');
}
exports.stripNbsp = stripNbsp;
/**
* stripSpan
*
* @param {string} html
* @returns {string}
*/
function stripHtmlAttributes(html) {
var spanRegex = /<\s*[^>]*>|<\/\s*[^>]*>/gi;
return html.replace(spanRegex, '');
}
exports.stripHtmlAttributes = stripHtmlAttributes;