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 :)
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
- in the file,
filter
not being a function, becauseimportPostData
callsposts.filter
, and if there is only oneposts
is an object, not an array. So this fixes that too :)