// Leave only `td` tags import { strict as assert } from "assert"; import { stripHtml } from "../dist/string-strip-html.esm.js"; const someHtml = `
cell1 cell2
cell3 cell4
`; assert.equal( stripHtml(someHtml, { onlyStripTags: ["td"], }).filteredTagLocations.reduce( (acc, [from, to]) => `${acc}${someHtml.slice(from, to)}`, "" ), `` );