And use it in a Markdown file (let's say README.md or index.md):
::: caption This is my title
This is my content
:::
The This is my title sentence is not given to the after function so the figcaption contains CAPTION (the type of the block).
The This is my content sentence is rendered correctly.
If you set a before function when configuring the plugin, the title will be given correctly.
Expected behavior
The given title should be used as argument when calling after function so it can be rendered.
Additional context
I did not search a lot but I found that the vuepress-plugin-container/src/index.ts calls renderAfter(info) (line 106) with a wrong info value, but the renderBefore(info) (line 104) contains the correct block's title. It seems the token.info passed to render (line 70) contains only the closing tag, the token has no link to the opening tag so no way to find back the title.
Maybe the "bug" is the documentation which should not tell users that it's possible to get block title in the after function.
Environment
Package version: vuepress-plugin-container@2.0.2 VuePress version: vuepress@1.4.0 Markdown It version: markdown-it@8.4.2 Node version: 13.11.0 npm version: 6.14.2 OS: Arch Linux Browser: Firefox 74.0 (but problem is on server-side rendering)
Describe the bug
When using the container plugin, the custom
after
function isn't called with the block title.Steps To Reproduce
Following this documentation: https://vuepress.github.io/en/plugins/container/#after
Configure the container plugin with a custom
after
function:And use it in a Markdown file (let's say
README.md
orindex.md
):The
This is my title
sentence is not given to theafter
function so thefigcaption
containsCAPTION
(the type of the block). TheThis is my content
sentence is rendered correctly. If you set abefore
function when configuring the plugin, the title will be given correctly.Expected behavior
The given title should be used as argument when calling
after
function so it can be rendered.Additional context
I did not search a lot but I found that the
vuepress-plugin-container/src/index.ts
callsrenderAfter(info)
(line 106) with a wronginfo
value, but therenderBefore(info)
(line 104) contains the correct block's title. It seems thetoken.info
passed torender
(line 70) contains only the closing tag, the token has no link to the opening tag so no way to find back the title.Maybe the "bug" is the documentation which should not tell users that it's possible to get block title in the
after
function.