Skip to content

Commit

Permalink
Merge branch 'develop' into gh-pages
Browse files Browse the repository at this point in the history
* develop:
  v3.2.120
  Feat(respecDocWriter): throw if not a ReSpec doc (closes #704) (#708)
  • Loading branch information
marcoscaceres committed Apr 21, 2016
2 parents 8cbba03 + 530df87 commit 049def8
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
1 change: 1 addition & 0 deletions builds/respec-w3c-common-3.2.120.build.js.map

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions builds/respec-w3c-common-3.2.120.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions builds/respec-w3c-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "respec",
"version": "3.2.119",
"version": "3.2.120",
"license": "W3C",
"description": "Specification Edition Support Tool.",
"bin": {
Expand Down
20 changes: 19 additions & 1 deletion tools/respecDocWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,25 @@ const tasks = {
const response = yield nightmare
.goto(url);
if (response.code !== 200) {
const msg = `HTTP Error ${response.code}: ${url}`;
const warn = colors.warn(`📡 HTTP Error ${response.code}:`);
const msg = `${warn} ${colors.debug(url)}`;
throw new Error(msg);
}
const isRespecDoc = yield nightmare
.wait(function(){
return document.readyState === "complete";
})
.evaluate(function(){
if(document.hasOwnProperty("respectIsReady")){
return true;
}
// does it try to load ReSpec locally or remotely
const remoteScriptQuery = "script[src='https://www.w3.org/Tools/respec/respec-w3c-common']";
const query = `script[data-main*=profile-w3c-common], ${remoteScriptQuery}`;
return (document.querySelector(query)) ? true : false;
});
if(!isRespecDoc){
const msg = `${colors.warn("💣 Not a ReSpec source document?")} ${colors.debug(url)}`;
throw new Error(msg);
}
const html = yield nightmare
Expand Down

0 comments on commit 049def8

Please sign in to comment.