Closed doncuomo closed 2 years ago
@boutell, I tried with the snippet given in this issue. I got the expected result. Following are the findings.
code snippet:
const sanitizeHtml = require('sanitize-html');
const output = sanitizeHtml('<a href="http://somelink">some text</a> blaat', {
transformTags: {
a: function(tagName, attribs) {
return {
tagName: tagName,
attribs: attribs,
text: 'somelinktext'
};
}
}
});
console.log(output);
Result obtained:
<a href="http://somelink">somelinktext</a> blaat
We can see that the result is the same as the expected result. I think we can close this issue, saying not reproducible anymore.
Thanks for testing.
You’re welcome.
I changed the following spec in your code to reproduce the error:
it('should replace text and attributes when they are changed by transforming function'
See the screenshot for my change:
Test result:
I expect blaat to be in the result, but it's cut off