function createMultiTagsRegexString(tags) {
    // create a string for a multi tags regexp
    return "(" + tags.join('|') + ")";
}
export function eraseNewLines(html) {
    return html.replace(/\n|\r/g, '');
}
export function filterByTag(tag, html) {
    var regex = new RegExp("<" + tag + "([^>]*)>([^]*)</" + tag + ">", 'gmi');
    return html.replace(regex, '');
}
export function filterByTags(tags, html) {
    return filterByTag(createMultiTagsRegexString(tags), html);
}
export function replaceTag(tag, replace, html) {
    var openingTag = new RegExp("<" + tag + "([^>]*)>", 'gmi');
    return html.replace(openingTag, "<" + replace + ">").replace(tag + ">", replace + ">");
}
export function replaceTags(tags, replace, html) {
    return replaceTag(createMultiTagsRegexString(tags), replace, html);
}
export function eraseTag(tag, html) {
    var regex = new RegExp("(<" + tag + "([^>]*)>)|(</" + tag + ">)", 'gmi');
    return html.replace(regex, '');
}
export function eraseTags(tags, html) {
    return eraseTag(createMultiTagsRegexString(tags), html);
}
export function eraseTagAndAllIsContent(tag, html) {
    var regex = new RegExp("(<" + tag + "([^>]*)>)[^>]*(</" + tag + ">)", 'gmi');
    return html.replace(regex, '');
}
//# sourceMappingURL=htmlClean.js.map