Comparing version 2.0.5 to 2.0.6
@@ -59,3 +59,3 @@ 'use strict'; | ||
if (relative === false) { | ||
out += " target=\"blank\""; | ||
out += " target=\"_blank\""; | ||
} | ||
@@ -76,2 +76,17 @@ | ||
function kebabCase (name) { | ||
return name | ||
.replace(/^[A-Z]/, function (m) { return m.toLowerCase(); }) | ||
.replace( | ||
/([0-9a-zA-Z])[\b\s]*([0-9A-Z])/g, | ||
function (m, g1, g2) { return (g1 + "-" + (g2.toLowerCase())); } | ||
) | ||
} | ||
function pascalCase (name) { | ||
return kebabCase(name) | ||
.replace(/-([0-9a-zA-Z])/g, function (m, g1) { return g1.toUpperCase(); }) | ||
.replace(/^[a-z]/, function (m) { return m.toUpperCase(); }) | ||
} | ||
var addESLint = function (code) { return ("/* eslint-disable */\n" + code + "\n"); }; | ||
@@ -109,3 +124,5 @@ | ||
return ("module.exports = (function (module) {\n" + compiled + "\n var exports = module.exports\n exports.name = \"" + componentName + "\"\n exports.methods = {\n beforeCreate: function () {\n const css = \"" + (css.replace(/\n/g, ' ')) + "\"\n if (css) {\n this._ic_ = insert(css)\n }\n },\n destroyed: function () {\n this._ic_ && this._ic_()\n }\n }\n module.exports.install = function (Vue) {\n Vue.component(exports.name, exports)\n }\n if (typeof window !== void 0 && window.Vue) {\n Vue.use(exports )\n }\n return module.exports;\n\n function insert(css) {\n var elem = document.createElement('style')\n elem.setAttribute('type', 'text/css')\n\n if ('textContent' in elem) {\n elem.textContent = css\n } else {\n elem.styleSheet.cssText = css\n }\n\n document.getElementsByTagName('head')[0].appendChild(elem)\n return function () {\n document.getElementsByTagName('head')[0].removeChild(elem)\n }\n }\n })({});\n") | ||
componentName = kebabCase(componentName); | ||
return ("/* eslint-disable */\nvar moduleExports = (function (module) {\n 'use strict';\n" + (indent(compiled.replace(/(\/\/\n\s*)+/g, ''), ' ')) + "\n var exports = module.exports\n exports.name = \"" + componentName + "\"\n exports.created = function () {\n const css = \"" + (css.replace(/\n/g, ' ')) + "\"\n if (css) {\n this.____ = insert(css)\n }\n }\n exports.destroyed = function () {\n this.____ && this.____()\n }\n module.exports.install = function (Vue) {\n Vue.component(exports.name, exports)\n }\n\n return module.exports;\n\n function insert(css) {\n var elem = document.createElement('style')\n elem.setAttribute('type', 'text/css')\n\n if ('textContent' in elem) {\n elem.textContent = css\n } else {\n elem.styleSheet.cssText = css\n }\n\n document.getElementsByTagName('head')[0].appendChild(elem)\n return function () {\n document.getElementsByTagName('head')[0].removeChild(elem)\n }\n }\n})({});\ntypeof exports === 'object' && typeof module !== 'undefined' && (module.exports = moduleExports);\ntypeof window !== void 0 && window.Vue && Vue.use(moduleExports);\nthis[\"" + (pascalCase(componentName)) + "\"] = moduleExports;\n") | ||
}; | ||
@@ -158,2 +175,3 @@ | ||
lang = 'autoit'; | ||
require('prismjs/components/prism-autoit'); | ||
} | ||
@@ -160,0 +178,0 @@ } |
@@ -55,3 +55,3 @@ import marked from 'marked'; | ||
if (relative === false) { | ||
out += " target=\"blank\""; | ||
out += " target=\"_blank\""; | ||
} | ||
@@ -72,2 +72,17 @@ | ||
function kebabCase (name) { | ||
return name | ||
.replace(/^[A-Z]/, function (m) { return m.toLowerCase(); }) | ||
.replace( | ||
/([0-9a-zA-Z])[\b\s]*([0-9A-Z])/g, | ||
function (m, g1, g2) { return (g1 + "-" + (g2.toLowerCase())); } | ||
) | ||
} | ||
function pascalCase (name) { | ||
return kebabCase(name) | ||
.replace(/-([0-9a-zA-Z])/g, function (m, g1) { return g1.toUpperCase(); }) | ||
.replace(/^[a-z]/, function (m) { return m.toUpperCase(); }) | ||
} | ||
var addESLint = function (code) { return ("/* eslint-disable */\n" + code + "\n"); }; | ||
@@ -105,3 +120,5 @@ | ||
return ("module.exports = (function (module) {\n" + compiled + "\n var exports = module.exports\n exports.name = \"" + componentName + "\"\n exports.methods = {\n beforeCreate: function () {\n const css = \"" + (css.replace(/\n/g, ' ')) + "\"\n if (css) {\n this._ic_ = insert(css)\n }\n },\n destroyed: function () {\n this._ic_ && this._ic_()\n }\n }\n module.exports.install = function (Vue) {\n Vue.component(exports.name, exports)\n }\n if (typeof window !== void 0 && window.Vue) {\n Vue.use(exports )\n }\n return module.exports;\n\n function insert(css) {\n var elem = document.createElement('style')\n elem.setAttribute('type', 'text/css')\n\n if ('textContent' in elem) {\n elem.textContent = css\n } else {\n elem.styleSheet.cssText = css\n }\n\n document.getElementsByTagName('head')[0].appendChild(elem)\n return function () {\n document.getElementsByTagName('head')[0].removeChild(elem)\n }\n }\n })({});\n") | ||
componentName = kebabCase(componentName); | ||
return ("/* eslint-disable */\nvar moduleExports = (function (module) {\n 'use strict';\n" + (indent(compiled.replace(/(\/\/\n\s*)+/g, ''), ' ')) + "\n var exports = module.exports\n exports.name = \"" + componentName + "\"\n exports.created = function () {\n const css = \"" + (css.replace(/\n/g, ' ')) + "\"\n if (css) {\n this.____ = insert(css)\n }\n }\n exports.destroyed = function () {\n this.____ && this.____()\n }\n module.exports.install = function (Vue) {\n Vue.component(exports.name, exports)\n }\n\n return module.exports;\n\n function insert(css) {\n var elem = document.createElement('style')\n elem.setAttribute('type', 'text/css')\n\n if ('textContent' in elem) {\n elem.textContent = css\n } else {\n elem.styleSheet.cssText = css\n }\n\n document.getElementsByTagName('head')[0].appendChild(elem)\n return function () {\n document.getElementsByTagName('head')[0].removeChild(elem)\n }\n }\n})({});\ntypeof exports === 'object' && typeof module !== 'undefined' && (module.exports = moduleExports);\ntypeof window !== void 0 && window.Vue && Vue.use(moduleExports);\nthis[\"" + (pascalCase(componentName)) + "\"] = moduleExports;\n") | ||
}; | ||
@@ -154,2 +171,3 @@ | ||
lang = 'autoit'; | ||
require('prismjs/components/prism-autoit'); | ||
} | ||
@@ -156,0 +174,0 @@ } |
{ | ||
"name": "md2vue", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"main": "./dist/md2vue.common.js", | ||
@@ -21,2 +21,5 @@ "module": "dist/md2vue.esm.js", | ||
"devDependencies": { | ||
"jest": "^21.2.1", | ||
"live-server": "^1.2.0", | ||
"npm-run-all": "^4.1.2", | ||
"rollup": "^0.47.4", | ||
@@ -28,6 +31,9 @@ "rollup-plugin-buble": "^0.15.0", | ||
"scripts": { | ||
"start": "rollup -c rollup.config.js -w", | ||
"start": "run-s build build-doc && run-p watch-build preview", | ||
"watch-build": "rollup -c rollup.config.js -w", | ||
"build": "rollup -c rollup.config.js", | ||
"preview": "npm run build && node test/ ./docs && live-server ./docs" | ||
"build-doc": "node build-doc", | ||
"preview": "live-server ./docs", | ||
"test": "jest" | ||
} | ||
} |
@@ -9,2 +9,2 @@ # md2vue | ||
See [test/index.js](./test/index.js) | ||
See [here](https://angusfu.github.io/md2vue/doc.html) or [here](./test/common.md) ~ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
360239
13
2027
7
3
4