Skip to content

重复的代码高亮处理 #1938

@Qusic

Description

@Qusic

https://github.com/hexojs/hexo-renderer-marked/blob/master/lib/renderer.js#L41-L47
https://github.com/hexojs/hexo/blob/master/lib/plugins/filter/before_post_render/backtick_code_block.js

这里我觉得可以把 backtick_code_block 这个 filter 去掉。
代码高亮本来作为 renderer 的任务就很合适,其次,post 不一定是 markdown 格式,但是 before_post_render 里目前对于代码块的处理完全是针对 markdown 的,其它模版可能会有不同的格式。
另外,高亮配置也要在不同的地方都读取和判断显得比较不优雅。hexojs/hexo-renderer-marked#26

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalewontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions