[TOC maxLevel=2] is rendered as plain text instead of generating a table of contents

オープン
#431 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
markdown
領域
frontend, web-dev

調査の方向性

まず、新しい HackMD ノートで例を再現し、レンダリングされた表示で [TOC] と [TOC maxLevel=2] を比較してください。[TOC maxLevel=1] について説明している公式チュートリアルのセクションを読んでください。issue ではソースファイルもテストも指定されていません。パラメーター付き構文が認識され、プレーンテキストではなく目次が生成されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Is this a hackmd.io issue?
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.

Image Image

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:

  1. Go to https://hackmd.io

  2. Create a new note

  3. Paste the content below:

    [TOC maxLevel=2]
    
    ### Section
    - ### Case1
    - ### Case2
    - ### Case3
    
  4. Switch to preview / rendered view

  5. 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hackmdio/hackmd-io-issues のほかの issue

hackmdio/hackmd-io-issues の issue をすべて見る

似ている issue

Web Dev の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。