Open da1z opened 2 years ago
I have the same problem, but with divs instead of headlines.
My solution to this (and since I'm preprocessing the html anyway because of #415):
document.querySelectorAll('a > div > img, a > h1 > img, a > h2 > img, a > h3 > img').forEach(img => {
const blockElem = img.parentNode;
blockElem.replaceWith(...Array.from(blockElem.childNodes));
});
This assumes you are using something like jsdom or domino to preprocess the html.
Same problem but with paragraph inside anchors.
this being converted to markdown as
which is not really valid. Is there workaround to make it converting to something like?
### [**MyHeading**](some url)