hexo-renderer-markdown-exit 1.0.2 → 2.0.1
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.
- package/dist/index.js +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("node:path"),g=require("@mdit/plugin-tab"),h=require("markdown-exit"),m=require("markdown-exit-shiki"),x=require("markdown-it-abbr"),f=require("markdown-it-anchor"),p=require("markdown-it-emoji"),k=require("markdown-it-footnote"),q=require("markdown-it-ins"),w=require("markdown-it-mark"),E=require("markdown-it-mathjax3-pro"),P=require("markdown-it-sub"),
|
|
1
|
+
"use strict";const a=require("node:path"),g=require("@mdit/plugin-tab"),h=require("markdown-exit"),m=require("markdown-exit-shiki"),x=require("markdown-it-abbr"),f=require("markdown-it-anchor"),p=require("markdown-it-emoji"),k=require("markdown-it-footnote"),q=require("markdown-it-ins"),w=require("markdown-it-mark"),E=require("markdown-it-mathjax3-pro"),P=require("markdown-it-sub"),_=require("markdown-it-sup"),b=require("markdown-it-task-lists"),y=require("markdown-exit-mermaid");class M{hexo;md;config;constructor(n){this.hexo=n,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"},...n.config.markdown_exit},this.md=h.createMarkdownExit(this.config.render_options),this.initPlugins()}initPlugins(){console.time("MarkdownExit: Load Default Plugins"),this.config.defaultPlugins!==!1&&this.md.use(p.full).use(k).use(w).use(P).use(_).use(x).use(q).use(b).use(m,this.config.code_options).use(y,this.config.mermaid_options).use(g.tab).use(f,this.config.anchor_options).use(E),console.timeEnd("MarkdownExit: Load Default Plugins"),console.time("MarkdownExit: Load User Plugins"),this.loadUserPlugins(),console.timeEnd("MarkdownExit: Load User Plugins")}loadUserPlugins(){const n=this.config.plugins||[];for(const r of n){const u=typeof r=="string",t=u?r:r.name,c=u?{}:r.options||{};try{const s=a.join(this.hexo.base_dir,"node_modules",t),d=require(s),l=d.default||d;this.md.use(l,c),process.env.DEBUG&&console.log(`✅ Successfully loaded plugin: ${t}`)}catch(s){console.warn(`⚠️ Failed to load plugin: ${t}`),process.env.DEBUG&&console.warn(` Error: ${s}`)}}}async render(n){return n.text?this.md.renderAsync(n.text):""}}let o=null;function U(){return o||(o=new M(hexo)),o}const e=async i=>await U().render(i);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
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A Hexo renderer plugin using markdown-exit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@mdit/plugin-tab": "^0.23.0",
|
|
24
24
|
"markdown-exit": "^1.0.0-beta.6",
|
|
25
|
+
"markdown-exit-mermaid": "^1.0.2",
|
|
25
26
|
"markdown-exit-shiki": "^0.1.4",
|
|
26
27
|
"markdown-it-abbr": "^2.0.0",
|
|
27
28
|
"markdown-it-anchor": "^9.2.0",
|