hexo-renderer-markdown-exit 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";const m=require("node:path"),h=require("@mdit/plugin-tab"),f=require("markdown-exit"),g=require("markdown-exit-mermaid"),x=require("markdown-exit-shiki"),p=require("markdown-it-abbr"),c=require("markdown-it-anchor"),k=require("markdown-it-emoji"),q=require("markdown-it-footnote"),w=require("markdown-it-ins"),P=require("markdown-it-mark"),y=require("markdown-it-mathjax3-pro"),E=require("markdown-it-sub"),b=require("markdown-it-sup"),_=require("markdown-it-task-lists");class j{hexo;md;config;constructor(e){this.hexo=e,this.config={render_options:{breaks:!0,html:!0,langPrefix:"language-",linkify:!0,quotes:"“”‘’",typographer:!0,xhtmlOut:!1},code_options:{themes:{light:"catppuccin-latte"}},mermaid_options:{theme:"default"},...e.config.markdown_exit},this.md=f.createMarkdownExit(this.config.render_options),this.initPlugins()}initPlugins(){console.time("MarkdownExit: Load Default Plugins"),this.config.defaultPlugins!==!1&&this.md.use(k.full).use(q).use(P).use(E).use(b).use(p).use(w).use(_).use(x,this.config.code_options).use(g,this.config.mermaid_options).use(h.tab).use(c,{permalink:c.permalink.headerLink()}).use(y),console.timeEnd("MarkdownExit: Load Default Plugins"),console.time("MarkdownExit: Load User Plugins"),this.loadUserPlugins(),console.timeEnd("MarkdownExit: Load User Plugins")}resolvePluginFunction(e){if(typeof e.default=="function")return e.default;if(typeof e=="function")return e;if(typeof e=="object"&&e!==null){for(const r in e)if(typeof e[r]=="function")return e[r]}return e}loadUserPlugins(){const e=this.config.plugins||[];for(const r of e){const u=typeof r=="string",t=u?r:r.name,d=u?{}:r.options||{};try{const o=m.join(this.hexo.base_dir,"node_modules",t),a=require(o),l=this.resolvePluginFunction(a);this.md.use(l,d),process.env.DEBUG&&console.log(`✅ Successfully loaded plugin: ${t}`)}catch(o){console.warn(`⚠️ Failed to load plugin: ${t}`),process.env.DEBUG&&console.warn(` Error: ${o}`)}}}async render(e){return e.text?this.md.renderAsync(e.text):""}}let s=null;function L(){return s||(s=new j(hexo)),s}const n=async i=>await L().render(i);n.disableNunjucks=!!hexo.config.markdown_exit.disableNunjucks;hexo.extend.renderer.register("md","html",n);hexo.extend.renderer.register("markdown","html",n);hexo.extend.renderer.register("mkd","html",n);hexo.extend.renderer.register("mkdn","html",n);hexo.extend.renderer.register("mdwn","html",n);hexo.extend.renderer.register("mdtxt","html",n);hexo.extend.renderer.register("mdtext","html",n);
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`node:path`);c=s(c);let l=require(`@mdit/plugin-tab`),u=require(`markdown-exit`),d=require(`markdown-exit-mermaid`);d=s(d);let f=require(`markdown-exit-shiki`);f=s(f);let p=require(`markdown-it-abbr`);p=s(p);let m=require(`markdown-it-anchor`);m=s(m);let h=require(`markdown-it-emoji`),g=require(`markdown-it-footnote`);g=s(g);let _=require(`markdown-it-ins`);_=s(_);let v=require(`markdown-it-mark`);v=s(v);let y=require(`markdown-it-mathjax3-pro`);y=s(y);let b=require(`markdown-it-sub`);b=s(b);let x=require(`markdown-it-sup`);x=s(x);let S=require(`markdown-it-task-lists`);S=s(S);var C=class{hexo;md;config;constructor(e){this.hexo=e,this.config={render_options:{breaks:!0,html:!0,langPrefix:`language-`,linkify:!0,quotes:`“”‘’`,typographer:!0,xhtmlOut:!1},code_options:{themes:{light:`catppuccin-latte`}},mermaid_options:{theme:`default`},...e.config.markdown_exit},this.md=(0,u.createMarkdownExit)(this.config.render_options),this.initPlugins()}initPlugins(){console.time(`MarkdownExit: Load Default Plugins`),this.config.defaultPlugins!==!1&&this.md.use(h.full).use(g.default).use(v.default).use(b.default).use(x.default).use(p.default).use(_.default).use(S.default).use(f.default,this.config.code_options).use(d.default,this.config.mermaid_options).use(l.tab).use(m.default,{permalink:m.default.permalink.headerLink()}).use(y.default),console.timeEnd(`MarkdownExit: Load Default Plugins`),console.time(`MarkdownExit: Load User Plugins`),this.loadUserPlugins(),console.timeEnd(`MarkdownExit: Load User Plugins`)}resolvePluginFunction(e){if(typeof e.default==`function`)return e.default;if(typeof e==`function`)return e;if(typeof e==`object`&&e){for(let t in e)if(typeof e[t]==`function`)return e[t]}return e}loadUserPlugins(){let e=this.config.plugins||[];for(let t of e){let e=typeof t==`string`,n=e?t:t.name,r=e?{}:t.options||{};try{let e=c.default.join(this.hexo.base_dir,`node_modules`,n),t=require(e),i=this.resolvePluginFunction(t);this.md.use(i,r),process.env.DEBUG&&console.log(`✅ Successfully loaded plugin: ${n}`)}catch(e){console.warn(`⚠️ Failed to load plugin: ${n}`),process.env.DEBUG&&console.warn(` Error: ${e}`)}}}async render(e){return e.text?this.md.renderAsync(e.text):``}},w=null;function T(){return w||=new C(hexo),w}var E=async e=>await T().render(e);E.disableNunjucks=!!hexo.config.markdown_exit.disableNunjucks,hexo.extend.renderer.register(`md`,`html`,E),hexo.extend.renderer.register(`markdown`,`html`,E),hexo.extend.renderer.register(`mkd`,`html`,E),hexo.extend.renderer.register(`mkdn`,`html`,E),hexo.extend.renderer.register(`mdwn`,`html`,E),hexo.extend.renderer.register(`mdtxt`,`html`,E),hexo.extend.renderer.register(`mdtext`,`html`,E);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-renderer-markdown-exit",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "description": "A Hexo renderer plugin using markdown-exit",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [
@@ -25,10 +25,10 @@
25
25
  "README.md"
26
26
  ],
27
27
  "dependencies": {
28
- "@mdit/plugin-tab": "^0.24.0",
29
- "markdown-exit": "^1.0.0-beta.8",
30
- "markdown-exit-mermaid": "^2.2.0",
31
- "markdown-exit-shiki": "^0.3.0",
28
+ "@mdit/plugin-tab": "^0.24.2",
29
+ "markdown-exit": "^1.0.0-beta.9",
30
+ "markdown-exit-mermaid": "^2.2.2",
31
+ "markdown-exit-shiki": "^0.3.2",
32
32
  "markdown-it-abbr": "^2.0.0",
33
33
  "markdown-it-anchor": "^9.2.0",
34
34
  "markdown-it-emoji": "^3.0.0",
@@ -41,12 +41,12 @@
41
41
  "markdown-it-task-lists": "^2.1.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@biomejs/biome": "^2.4.4",
44
+ "@biomejs/biome": "^2.4.10",
45
45
  "@types/hexo": "^7.0.0",
46
46
  "@types/markdown-it-emoji": "^3.0.1",
47
- "bun-types": "^1.3.10",
48
- "typescript": "^5.9.3",
49
- "vite": "^7.3.1"
47
+ "bun-types": "^1.3.11",
48
+ "typescript": "^6.0.2",
49
+ "vite": "^8.0.3"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "hexo": "^8.1.1",