md-editor-v3
Version:
Markdown editor for vue3, developed in jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...
3 lines (2 loc) • 800 B
JavaScript
;const u=require("./config.cjs"),a=(e,t="image.png")=>{const r=e.split(","),n=r[0].match(/:(.*?);/);if(n){const i=n[1],o=atob(r[1]);let s=o.length;const c=new Uint8Array(s);for(;s--;)c[s]=o.charCodeAt(s);return new File([c],t,{type:i})}return null},l=(e,t)=>{if(!e)return e;const r=t.split(`
`),n=['<span rn-wrapper aria-hidden="true">'];return r.forEach(()=>{n.push("<span></span>")}),n.push("</span>"),`<span class="${u.prefix}-code-block">${e}</span>${n.join("")}`},p=(e,t)=>{if(!e||!t)return 0;const r=e?.getBoundingClientRect();if(t===document.documentElement)return r.top-t.clientTop;const n=t?.getBoundingClientRect();return r.top-n.top},g=(()=>{let e=0;return()=>++e})();exports.base642File=a;exports.generateCodeRowNumber=l;exports.getRelativeTop=p;exports.getZIndexIncrement=g;