hexo-renderer-markdown-exit 3.1.1 → 3.1.2

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/README.md CHANGED
@@ -13,29 +13,16 @@ markdown_exit:
13
13
  typographer: true
14
14
  quotes: "“”‘’"
15
15
  plugins:
16
- - markdown-it-obsidian-callouts
17
- - name: markdown-it-inline-code
16
+ - name: markdown-it-obsidian-callouts
17
+ - name: "markdown-exit-image"
18
18
  options:
19
- themes:
20
- light: catppuccin-latte
21
- dark: catppuccin-mocha
22
- nord: nord
23
- tokyo: tokyo-night
19
+ supported_domains: ["assets.example.com"]
20
+ cache_path: ./thumbcache.json
24
21
  disableNunjucks: false
25
22
  ```
26
23
 
27
- ## Development
28
-
29
- ```shell
30
- # install dependencies
31
- bun i
32
- # build the project
33
- just build
34
- # after modifying the code, run lint
35
- just check
36
- ```
37
-
38
24
  ## Know Issues
39
25
 
40
- - [ ] `abbr` plugin not working
41
- - [ ] hexo custom tags not working
26
+ - Markdown content in "hexo custom tags"[^1] is not processed correctly.
27
+
28
+ [^1]: https://hexo.io/docs/tag-plugins
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"),_=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);
1
+ "use strict";const l=require("node:path"),h=require("@mdit/plugin-tab"),f=require("markdown-exit"),m=require("markdown-exit-mermaid"),g=require("markdown-exit-shiki"),x=require("markdown-it-abbr"),p=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"),_=require("markdown-it-sup"),b=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(_).use(x).use(w).use(b).use(g,this.config.code_options).use(m,this.config.mermaid_options).use(h.tab).use(p,this.config.anchor_options).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 t in e)if(typeof e[t]=="function")return e[t]}return e}loadUserPlugins(){const e=this.config.plugins||[];for(const t of e){const u=typeof t=="string",r=u?t:t.name,c=u?{}:t.options||{};try{const o=l.join(this.hexo.base_dir,"node_modules",r),d=require(o),a=this.resolvePluginFunction(d);this.md.use(a,c),process.env.DEBUG&&console.log(`✅ Successfully loaded plugin: ${r}`)}catch(o){console.warn(`⚠️ Failed to load plugin: ${r}`),process.env.DEBUG&&console.warn(` Error: ${o}`)}}}async render(e){return e.text?this.md.renderAsync(e.text):""}}let s=null;function M(){return s||(s=new j(hexo)),s}const n=async i=>await M().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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-renderer-markdown-exit",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "A Hexo renderer plugin using markdown-exit",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [