wikimedia / html-metadata

MetaData html scraper and parser for Node.js (supports Promises and callback style)
MIT License
138 stars 44 forks source link

Always add subproperties to the correct root #18

Closed mvolz closed 9 years ago

mvolz commented 9 years ago

Previously, subproperties were added to whatever root was created directly before them. Now checks to make sure the subproperty names match, e.g. og:image:width only gets added to the most recent og:image and not og:audio.

Also switched from overwriting latest sub-subproperty e.g. og:image:width to keeping first og:image:width added.

Added bad data to test_files and, and added tests of those files to verify that data is correctly added.

Issue #16