Skip to content

Commit

Permalink
Updated backwardcomp parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
glennjones committed Sep 9, 2015
1 parent 2db201d commit b178510
Show file tree
Hide file tree
Showing 155 changed files with 681 additions and 872 deletions.
16 changes: 8 additions & 8 deletions examples/chrome/microformat-shiv.js
@@ -1,6 +1,6 @@
/*
microformat-shiv - v1.1.4
Built: 2015-09-08 02:09 - http://microformat-shiv.com
Built: 2015-09-09 02:09 - http://microformat-shiv.com
Copyright (c) 2015 Glenn Jones
Licensed MIT
*/
Expand All @@ -22,7 +22,7 @@ var Microformats; // jshint ignore:line


modules.version = '1.1.4';
modules.livingStandard = '2015-08-20T13:50:36Z';
modules.livingStandard = '2015-09-09T11:11:13Z';

/**
* constructor
Expand All @@ -49,9 +49,9 @@ var Microformats; // jshint ignore:line
'baseUrl': '',
'filters': [],
'textFormat': 'whitespacetrimmed',
'dateFormat': 'auto',
'overlappingVersions': true,
'impliedPropertiesByVersion': false,
'dateFormat': 'auto', // html5 for testing
'overlappingVersions': false,
'impliedPropertiesByVersion': true,
'parseLatLonGeo': false
};
this.rootID = 0;
Expand Down Expand Up @@ -2993,9 +2993,9 @@ var Microformats; // jshint ignore:line
* @return {DOM node}
*/
createNodeWithText: function( tagName, text ){
return this.document
.createElement(tagName)
.appendChild(this.document.createTextNode(text));
var node = this.document.createElement(tagName);
node.innerHTML = text;
return node;
}


Expand Down
16 changes: 8 additions & 8 deletions examples/firefox/data/microformat-shiv.js
@@ -1,6 +1,6 @@
/*
microformat-shiv - v1.1.4
Built: 2015-09-08 02:09 - http://microformat-shiv.com
Built: 2015-09-09 02:09 - http://microformat-shiv.com
Copyright (c) 2015 Glenn Jones
Licensed MIT
*/
Expand All @@ -22,7 +22,7 @@ var Microformats; // jshint ignore:line


modules.version = '1.1.4';
modules.livingStandard = '2015-08-20T13:50:36Z';
modules.livingStandard = '2015-09-09T11:11:13Z';

/**
* constructor
Expand All @@ -49,9 +49,9 @@ var Microformats; // jshint ignore:line
'baseUrl': '',
'filters': [],
'textFormat': 'whitespacetrimmed',
'dateFormat': 'auto',
'overlappingVersions': true,
'impliedPropertiesByVersion': false,
'dateFormat': 'auto', // html5 for testing
'overlappingVersions': false,
'impliedPropertiesByVersion': true,
'parseLatLonGeo': false
};
this.rootID = 0;
Expand Down Expand Up @@ -2993,9 +2993,9 @@ var Microformats; // jshint ignore:line
* @return {DOM node}
*/
createNodeWithText: function( tagName, text ){
return this.document
.createElement(tagName)
.appendChild(this.document.createTextNode(text));
var node = this.document.createElement(tagName);
node.innerHTML = text;
return node;
}


Expand Down
16 changes: 8 additions & 8 deletions examples/opera/includes/microformat-shiv.js
@@ -1,6 +1,6 @@
/*
microformat-shiv - v1.1.4
Built: 2015-09-08 02:09 - http://microformat-shiv.com
Built: 2015-09-09 02:09 - http://microformat-shiv.com
Copyright (c) 2015 Glenn Jones
Licensed MIT
*/
Expand All @@ -22,7 +22,7 @@ var Microformats; // jshint ignore:line


modules.version = '1.1.4';
modules.livingStandard = '2015-08-20T13:50:36Z';
modules.livingStandard = '2015-09-09T11:11:13Z';

/**
* constructor
Expand All @@ -49,9 +49,9 @@ var Microformats; // jshint ignore:line
'baseUrl': '',
'filters': [],
'textFormat': 'whitespacetrimmed',
'dateFormat': 'auto',
'overlappingVersions': true,
'impliedPropertiesByVersion': false,
'dateFormat': 'auto', // html5 for testing
'overlappingVersions': false,
'impliedPropertiesByVersion': true,
'parseLatLonGeo': false
};
this.rootID = 0;
Expand Down Expand Up @@ -2993,9 +2993,9 @@ var Microformats; // jshint ignore:line
* @return {DOM node}
*/
createNodeWithText: function( tagName, text ){
return this.document
.createElement(tagName)
.appendChild(this.document.createTextNode(text));
var node = this.document.createElement(tagName);
node.innerHTML = text;
return node;
}


Expand Down
6 changes: 3 additions & 3 deletions lib/domutils.js
Expand Up @@ -577,9 +577,9 @@ var Modules = (function (modules) {
* @return {DOM node}
*/
createNodeWithText: function( tagName, text ){
return this.document
.createElement(tagName)
.appendChild(this.document.createTextNode(text));
var node = this.document.createElement(tagName);
node.innerHTML = text;
return node;
}


Expand Down
2 changes: 1 addition & 1 deletion lib/living-standard.js
@@ -1 +1 @@
modules.livingStandard = '2015-08-20T13:50:36Z';
modules.livingStandard = '2015-09-09T14:47:13Z';
6 changes: 3 additions & 3 deletions lib/parser.js
Expand Up @@ -35,9 +35,9 @@ var Modules = (function (modules) {
'baseUrl': '',
'filters': [],
'textFormat': 'whitespacetrimmed',
'dateFormat': 'auto',
'overlappingVersions': true,
'impliedPropertiesByVersion': false,
'dateFormat': 'auto', // html5 for testing
'overlappingVersions': false,
'impliedPropertiesByVersion': true,
'parseLatLonGeo': false
};
this.rootID = 0;
Expand Down
16 changes: 8 additions & 8 deletions microformat-shiv.js
@@ -1,6 +1,6 @@
/*
microformat-shiv - v1.1.4
Built: 2015-09-08 02:09 - http://microformat-shiv.com
Built: 2015-09-09 02:09 - http://microformat-shiv.com
Copyright (c) 2015 Glenn Jones
Licensed MIT
*/
Expand All @@ -22,7 +22,7 @@ var Microformats; // jshint ignore:line


modules.version = '1.1.4';
modules.livingStandard = '2015-08-20T13:50:36Z';
modules.livingStandard = '2015-09-09T11:11:13Z';

/**
* constructor
Expand All @@ -49,9 +49,9 @@ var Microformats; // jshint ignore:line
'baseUrl': '',
'filters': [],
'textFormat': 'whitespacetrimmed',
'dateFormat': 'auto',
'overlappingVersions': true,
'impliedPropertiesByVersion': false,
'dateFormat': 'auto', // html5 for testing
'overlappingVersions': false,
'impliedPropertiesByVersion': true,
'parseLatLonGeo': false
};
this.rootID = 0;
Expand Down Expand Up @@ -2993,9 +2993,9 @@ var Microformats; // jshint ignore:line
* @return {DOM node}
*/
createNodeWithText: function( tagName, text ){
return this.document
.createElement(tagName)
.appendChild(this.document.createTextNode(text));
var node = this.document.createElement(tagName);
node.innerHTML = text;
return node;
}


Expand Down
4 changes: 2 additions & 2 deletions microformat-shiv.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion microformat-shiv.min.js.map

Large diffs are not rendered by default.

17 changes: 3 additions & 14 deletions test/ci.html
Expand Up @@ -19,19 +19,15 @@
<script src="standards-tests/mf-mixed-h-card-tworoots.js"></script>
<script src="standards-tests/mf-mixed-h-entry-mixedroots.js"></script>
<script src="standards-tests/mf-mixed-h-resume-mixedroots.js"></script>
<script src="standards-tests/mf-v1-adr-justaname.js"></script>
<script src="standards-tests/mf-v1-adr-simpleproperties.js"></script>
<script src="standards-tests/mf-v1-geo-abbrpattern.js"></script>
<script src="standards-tests/mf-v1-geo-hidden.js"></script>
<script src="standards-tests/mf-v1-geo-justaname.js"></script>
<script src="standards-tests/mf-v1-geo-simpleproperties.js"></script>
<script src="standards-tests/mf-v1-geo-valuetitleclass.js"></script>
<script src="standards-tests/mf-v1-hcalendar-ampm.js"></script>
<script src="standards-tests/mf-v1-hcalendar-attendees.js"></script>
<script src="standards-tests/mf-v1-hcalendar-combining.js"></script>
<script src="standards-tests/mf-v1-hcalendar-concatenate.js"></script>
<script src="standards-tests/mf-v1-hcalendar-justahyperlink.js"></script>
<script src="standards-tests/mf-v1-hcalendar-justaname.js"></script>
<script src="standards-tests/mf-v1-hcalendar-time.js"></script>
<script src="standards-tests/mf-v1-hcard-email.js"></script>
<script src="standards-tests/mf-v1-hcard-format.js"></script>
Expand All @@ -41,27 +37,18 @@
<script src="standards-tests/mf-v1-hcard-multiple.js"></script>
<script src="standards-tests/mf-v1-hcard-name.js"></script>
<script src="standards-tests/mf-v1-hcard-single.js"></script>
<script src="standards-tests/mf-v1-hentry-justahyperlink.js"></script>
<script src="standards-tests/mf-v1-hentry-justaname.js"></script>
<script src="standards-tests/mf-v1-hentry-summarycontent.js"></script>
<script src="standards-tests/mf-v1-hfeed-simple.js"></script>
<script src="standards-tests/mf-v1-hnews-all.js"></script>
<script src="standards-tests/mf-v1-hnews-minimum.js"></script>
<script src="standards-tests/mf-v1-hproduct-aggregate.js"></script>
<script src="standards-tests/mf-v1-hproduct-justahyperlink.js"></script>
<script src="standards-tests/mf-v1-hproduct-justaname.js"></script>
<script src="standards-tests/mf-v1-hproduct-simpleproperties.js"></script>
<script src="standards-tests/mf-v1-hresume-affiliation.js"></script>
<script src="standards-tests/mf-v1-hresume-contact.js"></script>
<script src="standards-tests/mf-v1-hresume-education.js"></script>
<script src="standards-tests/mf-v1-hresume-justaname.js"></script>
<script src="standards-tests/mf-v1-hresume-skill.js"></script>
<script src="standards-tests/mf-v1-hresume-work.js"></script>
<script src="standards-tests/mf-v1-hreview-hyperlink.js"></script>
<script src="standards-tests/mf-v1-hreview-implieditem.js"></script>
<script src="standards-tests/mf-v1-hreview-item.js"></script>
<script src="standards-tests/mf-v1-hreview-justaname.js"></script>
<script src="standards-tests/mf-v1-hreview-photo.js"></script>
<script src="standards-tests/mf-v1-hreview-vcard.js"></script>
<script src="standards-tests/mf-v1-hreview-aggregate-hcard.js"></script>
<script src="standards-tests/mf-v1-hreview-aggregate-justahyperlink.js"></script>
Expand Down Expand Up @@ -154,9 +141,11 @@
<script src="interface-tests/isMicroformat-test.js"></script>
<script src="interface-tests/hasMicroformats-test.js"></script>

<script src="interface-tests/experimental-test.js"></script>

</head><body>
<h3 class="capitalize">Microformats-shiv: standards, interface tests</h3>
<p>Standards tests built on Thu Aug 20 2015 15:27:29 GMT+0100 (BST). Downloaded from github repo: microformats/tests version v0.1.21</p>
<p>Standards tests built on Wed Sep 09 2015 15:51:39 GMT+0100 (BST). Downloaded from github repo: microformats/tests version v0.1.23</p>
<div id="mocha"></div>
</body>
<script>window.onload= function(){
Expand Down
17 changes: 3 additions & 14 deletions test/coverage.html
Expand Up @@ -19,19 +19,15 @@
<script src="standards-tests/mf-mixed-h-card-tworoots.js"></script>
<script src="standards-tests/mf-mixed-h-entry-mixedroots.js"></script>
<script src="standards-tests/mf-mixed-h-resume-mixedroots.js"></script>
<script src="standards-tests/mf-v1-adr-justaname.js"></script>
<script src="standards-tests/mf-v1-adr-simpleproperties.js"></script>
<script src="standards-tests/mf-v1-geo-abbrpattern.js"></script>
<script src="standards-tests/mf-v1-geo-hidden.js"></script>
<script src="standards-tests/mf-v1-geo-justaname.js"></script>
<script src="standards-tests/mf-v1-geo-simpleproperties.js"></script>
<script src="standards-tests/mf-v1-geo-valuetitleclass.js"></script>
<script src="standards-tests/mf-v1-hcalendar-ampm.js"></script>
<script src="standards-tests/mf-v1-hcalendar-attendees.js"></script>
<script src="standards-tests/mf-v1-hcalendar-combining.js"></script>
<script src="standards-tests/mf-v1-hcalendar-concatenate.js"></script>
<script src="standards-tests/mf-v1-hcalendar-justahyperlink.js"></script>
<script src="standards-tests/mf-v1-hcalendar-justaname.js"></script>
<script src="standards-tests/mf-v1-hcalendar-time.js"></script>
<script src="standards-tests/mf-v1-hcard-email.js"></script>
<script src="standards-tests/mf-v1-hcard-format.js"></script>
Expand All @@ -41,27 +37,18 @@
<script src="standards-tests/mf-v1-hcard-multiple.js"></script>
<script src="standards-tests/mf-v1-hcard-name.js"></script>
<script src="standards-tests/mf-v1-hcard-single.js"></script>
<script src="standards-tests/mf-v1-hentry-justahyperlink.js"></script>
<script src="standards-tests/mf-v1-hentry-justaname.js"></script>
<script src="standards-tests/mf-v1-hentry-summarycontent.js"></script>
<script src="standards-tests/mf-v1-hfeed-simple.js"></script>
<script src="standards-tests/mf-v1-hnews-all.js"></script>
<script src="standards-tests/mf-v1-hnews-minimum.js"></script>
<script src="standards-tests/mf-v1-hproduct-aggregate.js"></script>
<script src="standards-tests/mf-v1-hproduct-justahyperlink.js"></script>
<script src="standards-tests/mf-v1-hproduct-justaname.js"></script>
<script src="standards-tests/mf-v1-hproduct-simpleproperties.js"></script>
<script src="standards-tests/mf-v1-hresume-affiliation.js"></script>
<script src="standards-tests/mf-v1-hresume-contact.js"></script>
<script src="standards-tests/mf-v1-hresume-education.js"></script>
<script src="standards-tests/mf-v1-hresume-justaname.js"></script>
<script src="standards-tests/mf-v1-hresume-skill.js"></script>
<script src="standards-tests/mf-v1-hresume-work.js"></script>
<script src="standards-tests/mf-v1-hreview-hyperlink.js"></script>
<script src="standards-tests/mf-v1-hreview-implieditem.js"></script>
<script src="standards-tests/mf-v1-hreview-item.js"></script>
<script src="standards-tests/mf-v1-hreview-justaname.js"></script>
<script src="standards-tests/mf-v1-hreview-photo.js"></script>
<script src="standards-tests/mf-v1-hreview-vcard.js"></script>
<script src="standards-tests/mf-v1-hreview-aggregate-hcard.js"></script>
<script src="standards-tests/mf-v1-hreview-aggregate-justahyperlink.js"></script>
Expand Down Expand Up @@ -154,9 +141,11 @@
<script src="interface-tests/isMicroformat-test.js"></script>
<script src="interface-tests/hasMicroformats-test.js"></script>

<script src="interface-tests/experimental-test.js"></script>

</head><body>
<h3 class="capitalize">Microformats-shiv: standards, interface tests</h3>
<p>Standards tests built on Thu Aug 20 2015 15:27:29 GMT+0100 (BST). Downloaded from github repo: microformats/tests version v0.1.21</p>
<p>Standards tests built on Wed Sep 09 2015 15:51:39 GMT+0100 (BST). Downloaded from github repo: microformats/tests version v0.1.23</p>
<div id="mocha"></div>
</body>

Expand Down
37 changes: 37 additions & 0 deletions test/interface-tests/experimental-test.js
@@ -0,0 +1,37 @@
/*
Unit test for get
*/

assert = chai.assert;


describe('experimental', function() {

it('h-geo - geo data writen as lat;lon', function(){

var expected = {
'items': [{
'type': ['h-geo'],
'properties': {
'name': ['30.267991;-97.739568'],
'latitude': [30.267991],
'longitude': [-97.739568]
}
}],
'rels': {},
'rel-urls': {}
},
options = {
'html': '<div class="h-geo">30.267991;-97.739568</div>',
'baseUrl': 'http://example.com',
'dateFormat': 'html5',
'parseLatLonGeo': true
};

var result = Microformats.get(options);
assert.deepEqual( result, expected );

});


});

0 comments on commit b178510

Please sign in to comment.