Socket
Socket
Sign inDemoInstall

@ziuchen/bytemd-plugin-markdown-theme

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ziuchen/bytemd-plugin-markdown-theme - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

12

dist/index.js

@@ -77,2 +77,14 @@ "use strict";

info.status = 0;
info.position = {
start: {
line: 0,
column: 0,
offset: 0
},
end: {
line: 0,
column: 0,
offset: 0
}
};
return;

@@ -79,0 +91,0 @@ }

8

dist/index.umd.js

@@ -1,5 +0,5 @@

(function(s,h){typeof exports=="object"&&typeof module!="undefined"?module.exports=h():typeof define=="function"&&define.amd?define(h):(s=typeof globalThis!="undefined"?globalThis:s||self,s.ziuchenBytemdPluginMarkdownTheme=h())})(this,function(){"use strict";const s='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 2H2.66667C2.29848 2 2 2.29848 2 2.66667V6C2 6.36819 2.29848 6.66667 2.66667 6.66667H6C6.36819 6.66667 6.66667 6.36819 6.66667 6V2.66667C6.66667 2.29848 6.36819 2 6 2Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path><path d="M6 9.3335H2.66667C2.29848 9.3335 2 9.63197 2 10.0002V13.3335C2 13.7017 2.29848 14.0002 2.66667 14.0002H6C6.36819 14.0002 6.66667 13.7017 6.66667 13.3335V10.0002C6.66667 9.63197 6.36819 9.3335 6 9.3335Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path><path d="M13.3334 2H10C9.63185 2 9.33337 2.29848 9.33337 2.66667V6C9.33337 6.36819 9.63185 6.66667 10 6.66667H13.3334C13.7016 6.66667 14 6.36819 14 6V2.66667C14 2.29848 13.7016 2 13.3334 2Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path><path d="M13.3334 9.3335H10C9.63185 9.3335 9.33337 9.63197 9.33337 10.0002V13.3335C9.33337 13.7017 9.63185 14.0002 10 14.0002H13.3334C13.7016 14.0002 14 13.7017 14 13.3335V10.0002C14 9.63197 13.7016 9.3335 13.3334 9.3335Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path></svg>',k={markdownTheme:"Markdown Theme"};function p(e){const w=(e==null?void 0:e.styleId)||"__markdown-theme__",C={...k,...e==null?void 0:e.locale},l=e==null?void 0:e.themes;if(!l)throw new Error("No markdown theme found, please check your options.");const a=Object.keys(l),u=(e==null?void 0:e.defaultTheme)||a[0];if(!a.length)throw new Error("No markdown theme found, please check your options.");if(!a.includes(u))throw new Error(`Invalid default markdown theme: ${u}, please check your options.`);const n={data:"",status:0,position:{start:{line:0,column:0,offset:0},end:{line:0,column:0,offset:0}}},m=t=>{const o=document.querySelector(`#${w}`)||document.createElement("style");o.setAttribute("id",w),document.head.appendChild(o),o.innerHTML=t},y=t=>({title:t,handler:{type:"action",click:({editor:o})=>{const d=o.getValue(),{start:i,end:f}=n.position,c=d.slice(i.offset,f.offset),r=n.status===0?`---
theme: ${t}
(function(s,l){typeof exports=="object"&&typeof module!="undefined"?module.exports=l():typeof define=="function"&&define.amd?define(l):(s=typeof globalThis!="undefined"?globalThis:s||self,s.ziuchenBytemdPluginMarkdownTheme=l())})(this,function(){"use strict";const s='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 2H2.66667C2.29848 2 2 2.29848 2 2.66667V6C2 6.36819 2.29848 6.66667 2.66667 6.66667H6C6.36819 6.66667 6.66667 6.36819 6.66667 6V2.66667C6.66667 2.29848 6.36819 2 6 2Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path><path d="M6 9.3335H2.66667C2.29848 9.3335 2 9.63197 2 10.0002V13.3335C2 13.7017 2.29848 14.0002 2.66667 14.0002H6C6.36819 14.0002 6.66667 13.7017 6.66667 13.3335V10.0002C6.66667 9.63197 6.36819 9.3335 6 9.3335Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path><path d="M13.3334 2H10C9.63185 2 9.33337 2.29848 9.33337 2.66667V6C9.33337 6.36819 9.63185 6.66667 10 6.66667H13.3334C13.7016 6.66667 14 6.36819 14 6V2.66667C14 2.29848 13.7016 2 13.3334 2Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path><path d="M13.3334 9.3335H10C9.63185 9.3335 9.33337 9.63197 9.33337 10.0002V13.3335C9.33337 13.7017 9.63185 14.0002 10 14.0002H13.3334C13.7016 14.0002 14 13.7017 14 13.3335V10.0002C14 9.63197 13.7016 9.3335 13.3334 9.3335Z" stroke="#1D2129" stroke-width="1.33" stroke-linejoin="round"></path></svg>',k={markdownTheme:"Markdown Theme"};function p(e){const w=(e==null?void 0:e.styleId)||"__markdown-theme__",C={...k,...e==null?void 0:e.locale},i=e==null?void 0:e.themes;if(!i)throw new Error("No markdown theme found, please check your options.");const a=Object.keys(i),u=(e==null?void 0:e.defaultTheme)||a[0];if(!a.length)throw new Error("No markdown theme found, please check your options.");if(!a.includes(u))throw new Error(`Invalid default markdown theme: ${u}, please check your options.`);const t={data:"",status:0,position:{start:{line:0,column:0,offset:0},end:{line:0,column:0,offset:0}}},m=n=>{const o=document.querySelector(`#${w}`)||document.createElement("style");o.setAttribute("id",w),document.head.appendChild(o),o.innerHTML=n},y=n=>({title:n,handler:{type:"action",click:({editor:o})=>{const d=o.getValue(),{start:h,end:f}=t.position,c=d.slice(h.offset,f.offset),r=t.status===0?`---
theme: ${n}
---
`:n.status===1?c.replace("---",`---
theme: ${t}`):c.replace(n.data,t);o.setValue(d.replace(c,r)),o.focus()}}});return{actions:[{title:C.markdownTheme,icon:s,handler:{type:"dropdown",actions:[...a.map(t=>y(t))]}}],remark:t=>t.use(()=>(o,d)=>{const i=l[u]||"";if(!d.frontmatter){m(i),n.status=0;return}const{start:f,end:c}=o.children[0].position;n.position={start:f,end:c};const{theme:r}=d.frontmatter;if(!r){m(i),n.status=1;return}if(a.includes(r)){m(l[r]),n.data=r,n.status=2;return}throw new Error(`Invalid markdown theme: ${r}, please check your options.`)})}}return p});
`:t.status===1?c.replace("---",`---
theme: ${n}`):c.replace(t.data,n);o.setValue(d.replace(c,r)),o.focus()}}});return{actions:[{title:C.markdownTheme,icon:s,handler:{type:"dropdown",actions:[...a.map(n=>y(n))]}}],remark:n=>n.use(()=>(o,d)=>{const h=i[u]||"";if(!d.frontmatter){m(h),t.status=0,t.position={start:{line:0,column:0,offset:0},end:{line:0,column:0,offset:0}};return}const{start:f,end:c}=o.children[0].position;t.position={start:f,end:c};const{theme:r}=d.frontmatter;if(!r){m(h),t.status=1;return}if(a.includes(r)){m(i[r]),t.data=r,t.status=2;return}throw new Error(`Invalid markdown theme: ${r}, please check your options.`)})}}return p});
{
"name": "@ziuchen/bytemd-plugin-markdown-theme",
"private": false,
"version": "1.0.1",
"version": "1.0.2",
"description": "ByteMD plugin to support custom markdown theme",

@@ -6,0 +6,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc