Repository navigation
fix: Markdownの番号付きリストが表示されない - #211
Merged
Merged
Conversation
Tailwind preflight が ol のマーカーと余白を消したまま、本文では箇条書きだけ戻していた。
cursor
Bot
force-pushed
the
cursor/fix-markdown-ordered-list-dae1
branch
from
November 8, 2026 15:04
7a27759 to
25ac980
Compare
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.
原因
Markdown は番号付きリストを
<ol>として出力している。パーサがリストを落としているわけではなく、サニタイズ処理もない。消えているのはマーカーである。
globals.cssの@tailwind baseが Tailwind の preflight を入れていて、そこではolとulがlist-style: noneかつpadding: 0になる。本文(.blog-body)は箇条書きのulだけlist-style: discとpadding-left: 1remに戻していた。番号付きリストの<ol>には同じ指定がなく、項目の文章だけが表示されていた。目次の
olは別で、list-style: noneのまま CSS カウンタ(counters(toc, '.'))で番号を出している。変更内容
src/layouts/BlogLayout.astroの.blog-bodyに、箇条書きと同じ余白と項目間隔で番号(list-style: decimal)を戻す指定を足した。目次は
.toc olの方が詳細度が高いので、カウンタ表示と余白はそのまま残る。パンくずのolは.blog-bodyの外なので影響しない。検証
ローカルの開発サーバで既存記事を表示して確認した。
/blog/burpex-burpeeのインストール手順は、修正前は番号なし、修正後は 1. から 4. が出る。狭い幅(390px)でも番号は欠けない。/blog/verify-release-binaryでも 1. から 7. が出るolは箇条書きと同じpadding-left: 1rem。2桁(10. 以降)も画面左で切れない/blog/site-tech-stack)のマーカーとインデントは変わらない。番号付きの入れ子は既存記事になかったため、本文にolを足して確認した。外側はstartどおり 3. から、内側は 1. から、内側の箇条書きは黒丸のまま/blog/burpex-burpeeの黒丸は修正前と同じ修正前
番号が出ていないインストール手順
修正後
番号が付いたインストール手順
狭い幅でも番号が出る
別記事の1から7
回帰
箇条書き
入れ子の箇条書き
目次
表
コードブロック
引用
To show artifacts inline, enable in settings.