hunterxuan / hexo-simple-mindmap Goto Github PK
View Code? Open in Web Editor NEWHexo Plugin: Display mindmap in post
Home Page: https://hunterx.xyz/hexo-simple-mindmap-plugin-intro.html
License: MIT License
Hexo Plugin: Display mindmap in post
Home Page: https://hunterx.xyz/hexo-simple-mindmap-plugin-intro.html
License: MIT License
hexo 4.2.0 ,
root节点为链接时未正常转义为a标签
导致思维导图生成失败
c[0].childNodes[0].nodeValue.trim() // 未检索到节点,报错
jquery.min.js:2 Uncaught TypeError: Cannot read property 'trim' of null
项目依赖
"dependencies": {
"hexo": "^4.0.0",
"hexo-abbrlink": "^2.0.5",
"hexo-blog-encrypt": "^3.0.12",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^1.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^2.0.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-server": "^1.0.0",
"hexo-symbols-count-time": "^0.7.0",
"hexo-tag-cloud": "^2.1.1"
}
主题
next 7.7.1
目前不清楚是hexo版本问题还是其他插件导致的,囧
请问作者有没有什么解决思路?
环境:
hexo3.9
next7
部署:
npm install hexo-simple-mindmap --save
现象:
插件安装成功,使用时未能展示思维导图的样式,控制台发现有报错
$(document).ready(function(){$(".mindmap").each(function(){MM_FUNCS.drawMindMap(this)})});var MM_FUNCS={li2jsonData:function(c){var a;var b=c.children("a:first");if(b.length!==0){a={"data":{"text":b.text(),"hyperlink":b.attr("href")}}}else{a={"data":{"text":c[0].childNodes[0].nodeValue.trim()}}}c.find("> ul > li").each(function(){if(!a.hasOwnProperty("children")){a.children=[]}a.children.push(MM_FUNCS.li2jsonData($(this)))});return a},drawMindMap:function(a){var d=$(a).find(">ul:first");var c={"root":{}};var b=new kityminder.Minder({renderTo:a});c.root=MM_FUNCS.li2jsonData(d.children("li:first"));b.importData("json",JSON.stringify(c));b.disable();b.execCommand("hand");$(d).hide()}};
大佬有无考虑移除jQuery库依赖
如果能定义样式(横向还是纵向)什么的就好了
INFO Validating config
DEMO
{% pullquote mindmap mindmap-md %}
{% endpullquote %}
当我运行npm install hexo-simple-mindmap --save
时, 输出如下:
Verion 9 of Highlight.js has reached EOL. It will no longer
be supported or receive security updates in the future.
Please upgrade to version 10 or encourage your indirect
dependencies to do so.
For more info:
https://github.com/highlightjs/highlight.js/issues/2877
https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md
也许npm package需要更新?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.