hexojs / hexo-renderer-markdown-it

Markdown-it is a Markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.
MIT License
341 stars 60 forks source link

postAsset config in markdown-it render #140

Closed fengkx closed 1 year ago

fengkx commented 3 years ago

I want to implement postAsset in markdown-it render.

I try implement it with a filter bind to markdown-it:renderer. But later I can't find a way to access data.path like here in the filter.

Is there any way to access the post currently render in markdown-it:render filter?

Maybe add an args when execute the filter may help?

this.execFilterSync('markdown-it:renderer', parser, { context: this , args: [data.path]});
SukkaW commented 3 years ago

See https://github.com/hexojs/hexo-renderer-marked/pull/173

fengkx commented 3 years ago

The problem is I cannot access data https://github.com/curbengh/hexo-renderer-marked/blob/d5c2ed1ec65fa400def711287e40d85befe405dc/lib/renderer.js#L227 in the filter @SukkaW

fengkx commented 3 years ago

Make a pull request about this #141