Open yagudaev opened 3 weeks ago
Quick workaround for now:
let markdown = turndownService.turndown(html)
if (html.match(/<figure.*?<\/figure>/gs)) {
markdown = markdown
.replace(/\[\s*\n*\s*!/gs, '[!')
.replace(/\)\s*\n*\s*]/gs, ')]')
}
First off, thank you so much for making this excellent library. It has been pretty much flawless 💜.
Found a bug when dealing with images from from Substack specifically.
The HTML is compressed and uses the
<figure>
tag.It works fine if the HTML has white spacing, but as soon as that whitespace is removed it fails.
Codesandbox Example
It adds new lines, breaking the image markdown formatting.