mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 21:57:15 +03:00
7 lines
536 KiB
JavaScript
7 lines
536 KiB
JavaScript
|
/**
|
||
|
* vue-markdown v2.2.4
|
||
|
* https://github.com/miaolz123/vue-markdown
|
||
|
* MIT License
|
||
|
*/
|
||
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueMarkdown=t():e.VueMarkdown=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.install=function(e){e.component("vue-markdown",n.default)};var n=function(e){return e&&e.__esModule?e:{default:e}}(r(1))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(2)),i=n(r(55)),a=n(r(59)),s=n(r(127)),l=n(r(133)),u=n(r(134)),c=n(r(135)),p=n(r(136)),h=n(r(137)),f=n(r(138)),d=n(r(139)),m=n(r(140)),g=n(r(153)),_=n(r(177));t.default={md:new a.default,template:"<div><slot></slot></div>",data:function(){return{sourceData:this.source}},props:{watches:{type:Array,default:function(){return["source","show","toc"]}},source:{type:String,default:""},show:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},html:{type:Boolean,default:!0},xhtmlOut:{type:Boolean,default:!0},breaks:{type:Boolean,default:!0},linkify:{type:Boolean,default:!0},emoji:{type:Boolean,default:!0},typographer:{type:Boolean,default:!0},langPrefix:{type:String,default:"language-"},quotes:{type:String,default:"“”‘’"},tableClass:{type:String,default:"table"},taskLists:{type:Boolean,default:!0},toc:{type:Boolean,default:!1},tocId:{type:String},tocClass:{type:String,default:"table-of-contents"},tocFirstLevel:{type:Number,default:2},tocLastLevel:{type:Number},tocAnchorLink:{type:Boolean,default:!0},tocAnchorClass:{type:String,default:"toc-anchor"},tocAnchorLinkSymbol:{type:String,default:"#"},tocAnchorLinkSpace:{type:Boolean,default:!0},tocAnchorLinkClass:{type:String,default:"toc-anchor-link"},anchorAttributes:{type:Object,default:function(){return{}}},prerender:{type:Function,default:function(e){return e}},postrender:{type:Function,default:function(e){return e}}},computed:{tocLastLevelComputed:function(){return this.tocLastLevel>this.tocFirstLevel?this.tocLastLevel:this.tocFirstLevel+1}},render:function(e){var t=this;this.md=(new a.default).use(l.default).use(u.default).use(c.default).use(p.default).use(h.default).use(f.default).use(d.default).use(g.default,{throwOnError:!1,errorColor:" #cc0000"}).use(_.default,{enabled:this.taskLists}),this.emoji&&this.md.use(s.default),this.md.set({html:this.html,xhtmlOut:this.xhtmlOut,breaks:this.breaks,linkify:this.linkify,typographer:this.typographer,langPrefix:this.langPrefix,quotes:this.quotes}),this.md.renderer.rules.table_open=function(){return'<table class="'+t.tableClass+'">\n'};var r=this.md.renderer.rules.link_open||function(e,t,r,n,o){return o.renderToken(e,t,r)};this.md.renderer.rules.link_open=function(e,n,o,a,s){return(0,i.default)(t.anchorAttributes).map(function(r){var o=e[n].attrIndex(r),i=t.anchorAttributes[r];o<0?e[n].attrPush([r,i]):e[n].attrs[o][1]=i}),r(e,n,o,a,s)},this.toc&&this.md.use(m.default,{tocClassName:this.tocClass,tocFirstLevel:this.tocFirstLevel,tocLastLevel:this.tocLastLevelComputed,anchorLink:this.tocAnchorLink,anchorLinkSymbol:this.tocAnchorLinkSymbol,anchorLinkSpace:this.tocAnchorLinkSpace,anchorClassName:this.tocAnchorClass,anchorLinkSymbolClassName:this.tocAnchorLinkClass,tocCallback:function(e,r,n){n&&(t.tocId&&document.getElementById(t.tocId)&&(document.getElementById(t.tocId).innerHTML=n),t.$emit("toc-rendered",n))}});var n=this.show?this.md.render(this.prerender(this.sourceData)):"";return n=this.postrender(n),this.$emit("rendered",n),e("div",{domProps:{innerHTML:n}})},beforeMount:function(){var e=this;if(this.$slots.default){this.sourceData="";var t=!0,r=!1,n=void 0;try{for(var i,a=(0,o.default)(this.$slots.default);!(t=(i=a.next()).done);t=!0){var s=i.value;this.sourceData+=s.text}}catch(e){r=!0,n=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw n}}}this.$watch("source"
|