@highlightjs/vue-plugin
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -1,1 +0,1 @@ | ||
import{defineComponent as e,ref as l,watch as a,computed as t,h as n}from"vue";import u from"highlight.js/lib/core";var r=e({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(e){var n=l(e.language);a((function(){return e.language}),(function(e){n.value=e}));var r=t((function(){return e.autodetect||!n.value})),o=t((function(){return!r.value&&!u.getLanguage(n.value)}));return{className:t((function(){return o.value?"":"hljs "+n.value})),highlightedCode:t((function(){var l;if(o.value)return console.warn('The language "'+n.value+'" you specified could not be found.'),e.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");if(r.value){var a=u.highlightAuto(e.code);return n.value=null!==(l=a.language)&&void 0!==l?l:"",a.value}return(a=u.highlight(e.code,{language:n.value,ignoreIllegals:e.ignoreIllegals})).value}))}},render:function(){return n("pre",{},[n("code",{class:this.className,innerHTML:this.highlightedCode})])}}),o={install:function(e){e.component("highlightjs",r)},component:r};export default o; | ||
import{defineComponent as e,ref as a,watch as l,computed as t,h as n}from"vue";import u from"highlight.js/lib/core";var r=e({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(e){var n=a(e.language);l((function(){return e.language}),(function(e){n.value=e}));var r=t((function(){return e.autodetect||!n.value})),o=t((function(){return!r.value&&!u.getLanguage(n.value)}));return{className:t((function(){return o.value?"":"hljs "+n.value})),highlightedCode:t((function(){var a;if(o.value)return console.warn('The language "'+n.value+'" you specified could not be found.'),e.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");if(r.value){var l=u.highlightAuto(e.code);return n.value=null!==(a=l.language)&&void 0!==a?a:"",l.value}return(l=u.highlight(e.code,{language:n.value,ignoreIllegals:e.ignoreIllegals})).value}))}},render:function(){return n("pre",{},[n("code",{class:this.className,innerHTML:this.highlightedCode,tabindex:"0"})])}}),o={install:function(e){e.component("highlightjs",r)},component:r};export default o; |
@@ -1,1 +0,1 @@ | ||
var hljsVuePlugin=function(e,n){"use strict";var u=e.defineComponent({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(u){var t=e.ref(u.language);e.watch((function(){return u.language}),(function(e){t.value=e}));var a=e.computed((function(){return u.autodetect||!t.value})),l=e.computed((function(){return!a.value&&!n.getLanguage(t.value)}));return{className:e.computed((function(){return l.value?"":"hljs "+t.value})),highlightedCode:e.computed((function(){var e;if(l.value)return console.warn('The language "'+t.value+'" you specified could not be found.'),u.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");if(a.value){var o=n.highlightAuto(u.code);return t.value=null!==(e=o.language)&&void 0!==e?e:"",o.value}return(o=n.highlight(u.code,{language:t.value,ignoreIllegals:u.ignoreIllegals})).value}))}},render:function(){return e.h("pre",{},[e.h("code",{class:this.className,innerHTML:this.highlightedCode})])}});return{install:function(e){e.component("highlightjs",u)},component:u}}(Vue,hljs); | ||
var hljsVuePlugin=function(e,n){"use strict";var t=e.defineComponent({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(t){var u=e.ref(t.language);e.watch((function(){return t.language}),(function(e){u.value=e}));var a=e.computed((function(){return t.autodetect||!u.value})),l=e.computed((function(){return!a.value&&!n.getLanguage(u.value)}));return{className:e.computed((function(){return l.value?"":"hljs "+u.value})),highlightedCode:e.computed((function(){var e;if(l.value)return console.warn('The language "'+u.value+'" you specified could not be found.'),t.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");if(a.value){var o=n.highlightAuto(t.code);return u.value=null!==(e=o.language)&&void 0!==e?e:"",o.value}return(o=n.highlight(t.code,{language:u.value,ignoreIllegals:t.ignoreIllegals})).value}))}},render:function(){return e.h("pre",{},[e.h("code",{class:this.className,innerHTML:this.highlightedCode,tabindex:"0"})])}});return{install:function(e){e.component("highlightjs",t)},component:t}}(Vue,hljs); |
{ | ||
"name": "@highlightjs/vue-plugin", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Highlight.js Vue Plugin", | ||
@@ -5,0 +5,0 @@ "main": "dist/highlightjs-vue.min.js", |
@@ -25,3 +25,3 @@ # Highlight.js plugin for Vue.js | ||
Note: For Vue.js version 2 support see the [1-stable](https://github.com/highlightjs/vue-plugin/tree/1-stable) branch here on GitHub. The `latest` tag via NPM is compatible with Vue.js v2; the `next` tag Vue.js v3. | ||
Note: For Vue.js version 2 support see the [1-stable](https://github.com/highlightjs/vue-plugin/tree/1-stable) branch here on GitHub. Version 1.x.x is compatible with Vue.js v2; version 2.x.x with Vue.js v3. | ||
@@ -28,0 +28,0 @@ ## Using the pre-built libraries |
@@ -71,2 +71,3 @@ import { ref, h, computed, defineComponent, Plugin, watch } from 'vue' | ||
innerHTML: this.highlightedCode, | ||
tabindex: '0', | ||
}), | ||
@@ -73,0 +74,0 @@ ]) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
12844
130
0