We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using a markdown-it plugin to add classes to <table> tags. This was broken by #3932.
<table>
If you look at: https://github.com/vuejs/vitepress/pull/3932/files#diff-332834eb76757b8e31926e411cef34f7207564d0bf5fd00a185b41d97b3403bf
md.renderer.rules.table_open = function (tokens, idx, options, env, self) { return '<table tabindex="0">\n' }
This breaks the chaining of any other modifications to the table_open rule. My understanding is that you should use the methods on token to modify the token and then chain to the existing rule. This post has a decent description: https://publishing-project.rivendellweb.net/customizing-markdown-it/#adding-classes-to-list-and-list-items
It looks like the overriding of math_blocks further down in the file does chain the original renderer.
math_blocks
In config.mts
config.mts
import markdownItClass from '@toycode/markdown-it-class' ... export default defineConfig({ ... markdown: { config: (md) => { md.use(markdownItClass, {table: ['table', 'table-striped']}) }, }, })
vitepress markdown.it plugin doesn't break other markdown.it plugin
System: OS: Windows 11 10.0.22631 CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz Memory: 9.01 GB / 31.75 GB Binaries: Node: 20.16.0 - C:\Program Files\nodejs\node.EXE npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD pnpm: 9.5.0 - C:\Program Files\nodejs\pnpm.CMD Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527
No response
The text was updated successfully, but these errors were encountered:
#4082 should fix this 👀
Sorry, something went wrong.
Agreed - sorry, I looked at open issues, but I didn't think to look at open PRs.
It looks like this PR has been open through several releases, is there anything I can do to support getting this into the next release?
No branches or pull requests
Describe the bug
I am using a markdown-it plugin to add classes to
<table>
tags. This was broken by #3932.If you look at: https://github.com/vuejs/vitepress/pull/3932/files#diff-332834eb76757b8e31926e411cef34f7207564d0bf5fd00a185b41d97b3403bf
This breaks the chaining of any other modifications to the table_open rule. My understanding is that you should use the methods on token to modify the token and then chain to the existing rule. This post has a decent description: https://publishing-project.rivendellweb.net/customizing-markdown-it/#adding-classes-to-list-and-list-items
It looks like the overriding of
math_blocks
further down in the file does chain the original renderer.Reproduction
In
config.mts
Expected behavior
vitepress markdown.it plugin doesn't break other markdown.it plugin
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: