From e776835a97d2d6876a28e4da988cbcaa55a297ee Mon Sep 17 00:00:00 2001 From: Ryan Engle Date: Tue, 10 Jan 2017 17:39:50 -0600 Subject: [PATCH] Update micro-rdfa-parser.js This was failing when I attempted to parse this page: https://www.cnet.com/products/bose-quietcomfort-35/ --- src/parsers/micro-rdfa-parser.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parsers/micro-rdfa-parser.js b/src/parsers/micro-rdfa-parser.js index 27edbaa..3e1aba3 100644 --- a/src/parsers/micro-rdfa-parser.js +++ b/src/parsers/micro-rdfa-parser.js @@ -52,7 +52,11 @@ const createHandler = function (specName) { if (attribs[PROP] && currentScope) { let newScope = {} currentScope[attribs[PROP]] = currentScope[attribs[PROP]] || [] - currentScope[attribs[PROP]].push(newScope) + if (Array.isArray(currentScope[attribs[PROP]])) { + currentScope[attribs[PROP]].push(value); + } else { + currentScope[attribs[PROP]] = value; + } currentScope = newScope } else { currentScope = {}