wzpan / hexo-tag-bootstrap

Bootstrap tag plugins for Freemind.
MIT License
27 stars 8 forks source link

only works with marked #8

Closed noraj closed 6 years ago

noraj commented 6 years ago

I use hexo-renderer-markdown-it instead of hexo-renderer-marked as markdown renderer but hexo-tag-bootstrap only works with marked.

ERROR Plugin load failed: hexo-tag-bootstrap
Error: Cannot find module 'marked'
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/x/node_modules/hexo-tag-bootstrap/card.js:11:14)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (/x/node_modules/hexo/lib/hexo/index.js:216:21)
    at /x/node_modules/hexo-tag-bootstrap/index.js:14:22
    at /x/node_modules/hexo/lib/hexo/index.js:232:12
    at tryCatcher (/x/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/x/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/x/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/x/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/x/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/x/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/x/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/x/node_modules/bluebird/js/release/promise.js:524:17)

Your plugin should works with all markdown renderer.

Note that both markdown renderer cannot co-exist: https://github.com/hexojs/hexo-renderer-markdown-it/wiki/Getting-Started

noraj commented 6 years ago

here are the files concerned https://github.com/wzpan/hexo-tag-bootstrap/search?utf8=%E2%9C%93&q=marked&type=

PS : I don't know much about javascript, but are you sure you even need a markdown renderer in your code ?

noraj commented 6 years ago

PS : as currently marked is a dependency of your plugin you should add it in package.json or if your code really need a markdown renderer and you want to support markdown-it as well you may want to add something like a try catch with the different markdown renderer used by hexo: marked, kramdown, markdown-it, pandoc

wzpan commented 6 years ago

Hi @noraj1337 , I use markdown-it too and it works in my blog. Such incompatible issue may relates to a recent pull request (#7 ) that use mark as renderer rather than use helper.

I will make a commit to fix it soon.

wzpan commented 6 years ago

I found those new tag plugins that are introduced since #7 are strongly marked-oriented and it's not easy to remove the dependency of marked from them.

For the moment, I create a bootstrap3 branch that should work with any renderers. Also you can downgrade your hexo-tag-bootstrap to 0.0.8 by executing:

npm uninstall hexo-tag-bootstrap
npm install --save hexo-tag-bootstrap@0.0.8

Please tell me whether these methods help.

corinis commented 6 years ago

I will try and adjust it so it works with markdown-it as well, the card control is the one that needs the rendered output adjusted to fit the bootstrap spec

noraj commented 6 years ago

I can't test right now. I opened an issue on hexo repo too https://github.com/hexojs/hexo/issues/2936

noraj commented 6 years ago

@wzpan I went back to hexo-tag-bootstrap@0.0.8 until @corinis or someone else give a proper way to avoid marked dependency.

corinis commented 6 years ago

Added a fix for the dependencyin the PR #10

noraj commented 6 years ago

I'll test as soon as it will be merged

noraj commented 6 years ago

@wzpan I saw that PR #10 was merged and that a release 0.1.2 is available on npmjs and was release 22 hours ago. But on your git repository I see no tag, no release, and package.json is still showing 0.1.1 so how are you release new package to npmjs?

noraj commented 6 years ago

I tried 0.1.2 and it's working without marked.