[TOC maxLevel=2] is rendered as plain text instead of generating a table of contents
还没有人认领这个 Issue。
评估
调研方向
首先,在新的 HackMD 笔记中复现该示例,并在渲染视图中比较 [TOC] 和 [TOC maxLevel=2]。阅读介绍 [TOC maxLevel=1] 的官方教程部分;issue 中没有指定源文件或测试。完成的标准是能够识别带参数的语法,并生成目录而不是纯文本。
由索引模型根据 Issue 内容生成。
描述
Is this a hackmd.io issue?
- Yes, the bug happens on https://hackmd.io
- No. If it's a self-hosted CodiMD instance, please fire up the issue in the repo of CodiMD: https://github.com/hackmdio/codimd
Read our Official tutorial
It's on https://hackmd.io/c/tutorials/
or Chinese version: https://hackmd.io/c/tutorials-tw/
What's the problem
Current behaviour
[TOC] works, but [TOC maxLevel=2] is rendered as plain text and does not generate a table of contents.
Reproducible content:
[TOC maxLevel=2]
### Section
- ### Case1
- ### Case2
- ### Case3
Actual rendered result:
[TOC maxLevel=2]
It is displayed as plain text instead of being parsed as TOC syntax.
Provide steps to reproduce:
-
Go to https://hackmd.io
-
Create a new note
-
Paste the content below:
[TOC maxLevel=2] ### Section - ### Case1 - ### Case2 - ### Case3 -
Switch to preview / rendered view
-
Observe that
[TOC maxLevel=2]is shown as plain text
Here is an example: https://hackmd.io/AkRF_wKqQWqpo_MJ32Veww
Expected behaviour
[TOC maxLevel=2] should be recognized as valid TOC syntax and generate a table of contents, instead of being rendered as plain text.
Environment
I use HackMD on:
Desktop
- OS: Windows / Ubuntu 24.04 / Android 14
- Browser: Chrome 147.0.7727.56 , FireFox 143.0(64 位元)
Mobile
- Device: Xiaomi Pro 13
- OS: Android 14
- Browser: Chrome 146.0.7880.177
Additional context
The official tutorial documents [TOC maxLevel=1] as supported syntax, so this behavior appears inconsistent with the documentation.
- 主要语言
- 没有语言数据
- 星标
- 40
- 派生
- 9
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hackmdio/hackmd-io-issues 的其他 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 62/100
hackmdio/hackmd-io-issues#121 ·
-
难度 4/5 3-5 天 新手友好度 25/100
hackmdio/hackmd-io-issues#448 ·
-
难度 4/5 3-5 天 新手友好度 15/100
hackmdio/hackmd-io-issues#447 ·
-
难度 4/5 3-5 天 新手友好度 45/100
hackmdio/hackmd-io-issues#446 ·
-
难度 4/5 3-5 天 新手友好度 22/100
hackmdio/hackmd-io-issues#445 · 3 条评论 ·
查看 hackmdio/hackmd-io-issues 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
enhancement
难度 1/5 1 小时以内 新手友好度 72/100
apache/maven-fluido-skin#387 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vercel-labs/ui#1494 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复