You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example the parser uses the textContent for u-url and u-uid. Based on the u-* parsing rules from http://microformats.org/wiki/microformats2-parsing i was expecting to get the href attribute. As rule 1 if a.u-x[href] or area.u-x[href] or link.u-x[href], then get the href attribute.
var chai = require('chai'),
assert = chai.assert,
helper = require('../test/helper.js');
describe('h-entry', function() {
var htmlFragment = "<li class=\"h-entry hentry\">\r\n <p class=\"p-name entry-title e-content entry-content\">\r\n Google the company *already* effectively rebranded, into Alphabet_Inc.\r\n <\/p>\r\n <span class=\"footer\"><a href=\"2019\/156\/t2\/\" class=\"dt-published published dt-updated updated u-url u-uid\"><time class=\"value\" datetime=\"11:56-0700\">11:56<\/time> on <time class=\"value\">2019-06-05<\/time><\/a><\/span>\r\n<\/li>";
var found = helper.parseHTML(htmlFragment,'http://example.com/');
var expected = "/2019/156/t2/";
it('u-url', function(){
var url = found.items[0].properties.url[0];
assert.equal(url, expected);
});
it('u-uid', function(){
var uid = found.items[0].properties.uid[0];
assert.equal(uid, expected);
});
});
The text was updated successfully, but these errors were encountered:
It looks like for some reason the <time> element inside the <a class="u-uid u-url"> is causing the parser to return the value of the <time> element as the url and uid properties. This is clearly a bug.
In the following example the parser uses the textContent for u-url and u-uid. Based on the u-* parsing rules from http://microformats.org/wiki/microformats2-parsing i was expecting to get the href attribute. As rule 1
if a.u-x[href] or area.u-x[href] or link.u-x[href], then get the href attribute
.The text was updated successfully, but these errors were encountered: