LoginSignup
2
0

More than 3 years have passed since last update.

GitHub PagesでMarkdownの<details>内要素がパースされない

Last updated at Posted at 2021-02-24

全て

問題

GitHub Pagesを作成する際, JekyllによるMarkdownからのHTMLページ生成を行ったが<details>内要素がパースされなかった.

image.png

なぜ

JekyllではHTML生成にkramdownが使われているが, 標準でparse_block_htmlfalseになっているためパースされないのであった.

<details><summary>test</summary>
```ruby
p "hello"
\```
</details>

(注: \はエスケープの為入れています.)

解決

ページ生成時のrootディレクトリに作成した_config.yml

_config.yml
markdown: CommonMarkGhPages

を追記して解決.

image.png

注意

_config.yml
markdown: kramdown
kramdown:
  parse_block_html: true

と記述すると, 1ページ内に複数<details>が存在した場合, バグる.

image.png

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0