hexojs / hexo-renderer-marked

Markdown renderer for Hexo
MIT License
179 stars 94 forks source link

feat: new option figcaption #264

Closed stevenjoezhang closed 1 year ago

stevenjoezhang commented 1 year ago

Append figcaption element after each image. This feature is supported by other renderers, e.g. hexo-renderer-pandoc. https://pandoc.org/MANUAL.html#extension-implicit_figures

coveralls commented 1 year ago

Coverage Status

coverage: 100.0%. remained the same when pulling 13f1ad55d5678599bb336ae9fa63e0e0043888f7 on figcaption into 906eae359ee8c8f028e3b4ed8f871e729491e6b8 on master.

haiweichai commented 1 month ago

@stevenjoezhang 您好,在 _config.yml 中添加 figcaption: true 可以正确渲染 image caption。

但是原本宽度100%的图片在 image caption 正确渲染时会略微缩小。请问该如何屏蔽图片尺寸缩小的功能呢?

我注意到目前 marker 只能使用 markdown 语法书写才能正确渲染 image caption,而 markdown 语法下似乎没法很简单的调节宽度。这确实带来了一点排版上不便。非常感谢!

stevenjoezhang commented 1 month ago

@haiweichai 你有具体的例子吗?我不确定略微缩小是为何产生的,image caption是附加上去的元素,理应不会影响图片大小。你也可以尝试通过自定义的CSS进行调整。