Package's name
string-strip-html
Describe the bug
GIVEN I enable the option dumpLinkHrefsNearby
WHEN I pass an HTML with an empty href
THEN the output fails and returns the HTML partially
To Reproduce
Steps to reproduce the behavior:
Given the following test
const html = `
<footer>
<div>
<div>
<div><img src="assets/img/png/test.png" alt="" /></div>
<div><span>Copyright 2022 test</span></div>
<div>
<a href=""><i aria-hidden="true"></i></a>
</div>
</div>
</div>
</footer>
`;
const { result } = stripHtml(html, {
dumpLinkHrefsNearby: {
enabled: true
}
});
assert(result === 'Copyright 2022 test');
The output I am getting is:
<footer>
<div>
<div>
<div><img src="assets/img/png/test.png" alt="" /></div>
<div><span>Copyright 2022 test</span></div>
<div>
<a href="
Expected behavior
Screenshots
N/A
Additional context
N/A