`<not-plaintext>` with links inside returns links url
- Maizzle Version: 4.2.0
- Node.js Version: 18.9.0
The following code
<not-plaintext>
<p>No images? <a href="url">Click here</a>
</p>
</not-plaintext>
returns
url
when generating the text version.
It should return no text.
It's happening because of dumpLinkHrefsNearby in string-strip-html - might be a bug there as it would make sense to not output any hrefs from tags that have been removed.
In Maizzle you can disable it by setting it to false in build.templates.plaintext.options, however I'll push an update soon to make it work just like in the docs, i.e. all plaintext options should go in build.templates.plaintext without the need for the options key.
Opened an issue with string-strip-html: https://github.com/codsen/codsen/issues/54
@michellaurent in the end we had to work around the issue in Maizzle, the string-strip-html library is now ESM and we're still CJS, and fixing this bug in their old CJS version would have not been sustainable in the long run.
Will release the fix in 4.2.3 sometime today, thanks for spotting it!
@cossssmin Thanks !