0

jekyll を使用して、アイテムの番号付きリストを含む HTML ドキュメントを作成したいと考えています。つまり<ol>、HTML で。テーブルを含むアイテムがあります。リストはテーブルの後で停止しますが、kramdown を直接使用せず、jekyll を使用した場合のみです。

jekyll バージョン 2.2.0 と kramdown バージョン 1.4.1 を実行しています。

これを再現するために、 を使用して新しいサイトを作成しjekyll new thatます。次に、次の名前の新しいマークダウン ドキュメントを作成しますthis.md

---
layout: page
title: This
permalink: /this/
---

1. first

   |table|table|
   |-----|-----|
   |conte|nt   |

1. second
1. third

そして実行しjekyll serveます。

これにより、次の HTML コードが生成されますhttp://localhost:4000/this/(関連する部分のみを引用)。

  <ol>
  <li>first</li>
</ol>

<table>
  <thead>
    <tr>
      <th>table</th>
      <th>table</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>conte</td>
      <td>nt</td>
    </tr>
  </tbody>
</table>

<ol>
  <li>second</li>
  <li>third</li>
</ol>

これは明らかに私が望むものではありません。そして実行kramdown this.mdすると、私が望むものが得られます:

<ol>
  <li>
    <p>first</p>

    <table>
      <thead>
        <tr>
          <th>table</th>
          <th>table</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>conte</td>
          <td>nt</td>
        </tr>
      </tbody>
    </table>
  </li>
  <li>second</li>
  <li>third</li>
</ol>

<ol>つまり、各テーブルの後に新しいリストを作成するのではなく、複数の項目を含む1 つのリストが必要です。

jekyll の違いは何ですか? そして、どうすればこの問題を解決できますか?

4

1 に答える 1

2

kramdown docに見られるように、複数行のリストは扱いにくいため、 list と table の両方のインデントを微調整する必要があります:

1. first (0 space indentation) NOT WORKING

   |table|  - 3 spaces indent|
   |-----|-----|
   |conte|nt   |

2. second (0 space indentation) NOT WORKING

    |table|  - 4 spaces indent|
    |-----|-----|
    |conte|nt   |

 3. third (1 space indentation) NOT WORKING

   |table|  - 3 spaces indent|
   |-----|-----|
   |conte|nt   |

 4. fourth (1 space indentation) **WORKS GOOOOOD !!**

    |table|  - 4 spaces indent|
    |-----|-----|
    |conte|nt   |


 5. fifth - tip of the day - add a class to table

    {:.table}
    |table|  - 4 spaces indent|
    |-----|-----|
    |conte|nt   |
于 2014-08-12T13:17:02.487 に答える