multiStoreAdmin/dist/storePage/assets/@highlightjs.b8b719e9.js

2 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-06-07 17:39:35 +08:00
import{c as u}from"./highlight.js.31cd7941.js";import{d as c,r as d,w as s,b as t,h as g}from"./@vue.c3e77981.js";var i=c({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(e){var a=d(e.language);s(function(){return e.language},function(n){a.value=n});var r=t(function(){return e.autodetect||!a.value}),o=t(function(){return!r.value&&!u.getLanguage(a.value)});return{className:t(function(){return o.value?"":"hljs "+a.value}),highlightedCode:t(function(){var n;if(o.value)return console.warn('The language "'+a.value+'" you specified could not be found.'),e.code.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;");if(r.value){var l=u.highlightAuto(e.code);return a.value=(n=l.language)!==null&&n!==void 0?n:"",l.value}return(l=u.highlight(e.code,{language:a.value,ignoreIllegals:e.ignoreIllegals})).value})}},render:function(){return g("pre",{},[g("code",{class:this.className,innerHTML:this.highlightedCode})])}}),f={install:function(e){e.component("highlightjs",i)},component:i};export{f as o};