diff --git a/demo/default.htm b/demo/default.htm index 8ceebf20..2fee6b77 100644 --- a/demo/default.htm +++ b/demo/default.htm @@ -31,9 +31,7 @@ - - diff --git a/demo/markdown-it-stub.js b/demo/markdown-it-stub.js new file mode 100644 index 00000000..88fc2f41 --- /dev/null +++ b/demo/markdown-it-stub.js @@ -0,0 +1,7 @@ +"use strict"; + +// Alias "markdown-it" (expected) to "markdownit" (exported) +module.exports = window.markdownit; +if (!module.exports) { + console.error("markdown-it must be loaded before markdownlint."); +} diff --git a/demo/offline.appcache b/demo/offline.appcache index eaa407db..ad072207 100644 --- a/demo/offline.appcache +++ b/demo/offline.appcache @@ -1,12 +1,10 @@ CACHE MANIFEST -# 2015-05-08 -browser-polyfills.js +# 2015-06-17 default.css default.htm default.js favicon.ico markdown-it.min.js markdownlint-browser.js -require-stub.js NETWORK: * diff --git a/demo/require-stub.js b/demo/require-stub.js deleted file mode 100644 index 9fcb8013..00000000 --- a/demo/require-stub.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -// Aliases "markdown-it" (expected) for "markdownit" (exported) -function require(module) { - if (module === "markdown-it") { - return window.markdownit; - } -} diff --git a/package.json b/package.json index 22fa7268..acd8e720 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "test": "nodeunit", "test-cover": "istanbul cover node_modules/nodeunit/bin/nodeunit", "debug": "node debug node_modules/nodeunit/bin/nodeunit", - "lint": "eslint lib test & eslint --env browser --global markdownit --global markdownlint --rule \"no-unused-vars: 0, no-extend-native: 0, max-statements: 0\" demo & eslint --rule \"no-console: 0, no-shadow: 0\" example", - "build-demo": "copy node_modules\\markdown-it\\dist\\markdown-it.min.js demo & browserify lib/markdownlint.js --standalone markdownlint --exclude markdown-it --outfile demo/markdownlint-browser.js", + "lint": "eslint lib test & eslint --env browser --global markdownit --global markdownlint --rule \"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0\" demo & eslint --rule \"no-console: 0, no-shadow: 0\" example", + "build-demo": "copy node_modules\\markdown-it\\dist\\markdown-it.min.js demo & browserify demo/browser-polyfills.js lib/markdownlint.js --standalone markdownlint --outfile demo/markdownlint-browser.js", "example": "npm install through2 & cd example & node standalone.js & grunt markdownlint & gulp markdownlint" }, "dependencies": { @@ -35,5 +35,8 @@ "md", "check", "validate" - ] + ], + "browser": { + "markdown-it": "./demo/markdown-it-stub.js" + } }