GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.06k stars 407 forks source link

feat: add wxr-parser tests, fix failure to import single-item WXR file #1239

Closed myelin closed 8 months ago

myelin commented 10 months ago

This is mainly the start of a spec file for wxr-parser.js; I want to do some work on image import (fixing a bug where two different image URLs with the same basename will overwrite each other), and this is prep work for that.

While writing the spec file, I spotted a bug where an WXR file with a single causes an error about filter not being a function, because importPostData calls posts.filter, and if there is only one in the file, posts is an object, not an array. So this fixes that too :)