We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f5ef394 + 44ec273 commit 5ff79feCopy full SHA for 5ff79fe
test/parser.spec.js
@@ -202,4 +202,17 @@ describe('parser', () => {
202
expect(Array.isArray(strictResult.items)).toBe(true);
203
expect(strictResult.items.length).toBe(0);
204
});
205
+
206
+ test('recognizes self-closing tags', () => {
207
+ const html =
208
+ '<div itemscope>' +
209
+ ' <span itemprop="price" content="139.90" />' +
210
+ ' foo' +
211
+ ' bar' +
212
+ '</div>';
213
+ const result = parser.toJson(html);
214
+ expect(Array.isArray(result.items)).toBe(true);
215
+ expect(result.items.length).toBe(1);
216
+ expect(result.items[0].properties.price[0]).toBe('139.90');
217
+ });
218
0 commit comments