lonekorean/wordpress-export-to-markdown

postContent.matchAll(...) is not a function or its return value is not iterable

RalphCorderoy opened this issue · 3 comments

I get the error postContent.matchAll(...) is not a function or its return value is not iterable. Looking at the XML, there's only two posts and neither have images. (Most of the XML is pages rather than posts.)

const matches = [...postContent.matchAll(/<img[^>]*src="(.+?\.(?:gif|jpe?g|png))"[^>]*>/gi)];

Are you using Node.js v12.14 or later?

Hi @lonekorean, No, I agree, that's the problem: there's no matchAll in Debian Stable. Sorry for the noise.

@RalphCorderoy no worries. I should probably add a check in code and give a more helpful error message. :)