2017-05-04 10 views
1

を合わせていない、このテキストは、例えば、適切

1. first item 
2. second item 
    - first subitem 
    - second subitem 
    more info about the 2nd item 
3. third item 

は、私は、「第2項目についての詳細情報」を取得するにはどうすればよいこの

enter image description here

を生成しますコード内のどこに表示されますか?

答えて

2

次の副題箇条書きの中の独立した段落として、「詳細」をpandocマークダウンに置きます。

1. first item 
2. second item 
    - first subitem 
    - second subitem 

     more info about the 2nd item 

3. third item 

出力:

<ol style="list-style-type: decimal"> 
<li>first item</li> 
<li>second item 
<ul> 
<li>first subitem</li> 
<li><p>second subitem</p> 
<p>more info about the 2nd item</p></li> 
</ul></li> 
<li>third item</li> 
</ol> 
0

これは私もエレガントな方法で解決するように見えることはできません厄介な問題です。ただし、HTMLへのコンパイルでは、単純な回避策があります。ネストされたリストの最後の項目の後に</ul>または</ol>タグを配置します。

1. first item 
2. second item 
    - first subitem 
    - second subitem</ul> 
    more info about the 2nd item 
3. third item 

これは、Markdownが指示する前に、この場合は順序付けられていないリストを終了するようにHTMLをトリガーします。幸運にも、これはあなたのレイアウトを一切壊さず、順序なし(<ul>)と注文した(<ol>)リストを混合している限り、です。あなたのネストされたリストがその親と同じタイプのものなら、あなたのレイアウトを壊します*。

希望する場合は、ネストされたリストに属していない最初の行の前に<br>要素を配置して、視覚的に魅力的なレイアウトを作成することもできます。