lonekorean / wordpress-export-to-markdown

Converts a WordPress export XML file into Markdown files.
MIT License
1.14k stars 227 forks source link

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

Closed RalphCorderoy closed 3 years ago

RalphCorderoy commented 3 years ago

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)];
lonekorean commented 3 years ago

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

RalphCorderoy commented 3 years ago

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

lonekorean commented 3 years ago

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