Repository navigation
Upgrade VitePress to 2.0.0-alpha.20 and replace markdown-it-multimd-table with native table attributes - #53
Merged
Merged
Conversation
…able with native table attributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
2.0.0-alpha.18→2.0.0-alpha.20(next通道,跟随官方 alpha 演进)markdown-it-multimd-table(2023-08 后无发布、事实性停更),改用 VitePress alpha 内置的 官方表格属性语法{colspan=2}实现合并单元格背景与根因
升级到 alpha.19 后全站构建崩溃:
排查结论(双层兼容性 bug,源码级定位):
markdown-it-multimd-table@4.2.3的行扫描器把未配对的单个反引号当作代码段开关,吞掉其后所有|分隔符 → 4 列表格被解析成 3 格行;@mdit/plugin-attrs(替代 markdown-it-attrs)在table tbody calculate中以表头列数索引单元格数组、无越界防护 →cells[3]为undefined时崩溃。该项目仅用到了 multimd 的“合并列(HTML 注释标记)”这一特性,且 alpha 系列官方已提供等价能力。
改动
docs/tables/index.mddocs/.vitepress/config.mtsmarkdownItMultimdTable引用package.jsonvitepress升至2.0.0-alpha.20pnpm-workspace.yamlminimumReleaseAgeExclude: vitepress@2.0.0-alpha.20(pnpm 供应链年龄策略自动写入)附带修复:
docs/tables/index.mdASCII 参考表中`、`|`、`||`等反引号单元格此前在 multimd 下被错误解析为 code span,现按原生语法正确渲染。验证
pnpm docs:build通过(alpha.20,约 46s)tables/index.html:4 处colspan="2"与旧输出一致