UNPKG

epubinator

Version:

NPM package to generate epub files out of url

26 lines (25 loc) 585 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stripHtmlAttributes = exports.stripNbsp = void 0; /** * stripNbsp * * @param {string} html * @returns {string} */ function stripNbsp(html) { var nbspRegex = /&nbsp;/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;