2016-03-08 23 views
3

我有以下代碼添加液體代碼塊之後復位編號列表:化身Kramdown代碼 - 號碼重

... 
6. Install the Ruby Google API client with `gem install google-api-client`, or if you prefer in a Gemfile: 
    {% highlight ruby lineanchors %} 
    source 'https://rubygems.org' 
    gem 'google-api-client', '~> 0.9.1' 
    {% endhighlight %} 
(If you've never used [Bundler](http://bundler.io) before, you should start!) 

7. Let's get a quick script set up to post a Google Calendar event to... 

的問題是,下面將呈現爲:


fail


有序列表被重置,這顯然是一個問題。我看過many postsdetail the markdown ordered list reset problem但他們都沒有討論液體標籤。我發現另一個帖子here討論這個問題無濟於事。

這裏是HTML輸出,以防萬一它是必要的。該<ol>標籤顯然是被由液體標籤發動機產生一個<div>元素打破...我不知道如何嵌入pre塊在<ol>塊...

<ol> 
    ... 
    <li>Install the Ruby Google API client with <code>gem install google-api-client</code>, or if you prefer in a Gemfile:</li> 
</ol> 
<div class="highlight"><pre><code class="language-ruby" data-lang="ruby"><a name="True-1"></a><span class="n">source</span> <span class="s1">'https://rubygems.org'</span> 
<a name="True-2"></a><span class="n">gem</span> <span class="s1">'google-api-client'</span><span class="p">,</span> <span class="s1">'~&gt; 0.9.1'</span></code></pre></div> 
<p>(If you’ve never used <a href="http://bundler.io">Bundler</a> before, you should start!)</p> 
<ol> 
    <li>Let’s get a quick script set up to post a Google Calendar event to</li> 
    <li>Let’s get a quick script set up to post a Google Calendar event to</li> 
</ol> 

我想成爲能夠將液體標記放置在有序列表中,而不會打破<ol>HTML元素並重置編號。有沒有辦法做到這一點?

+0

你倒黴了。 https://github.com/jekyll/jekyll/issues/588 – approxiblue

+0

一些不完美的解決方法:http://stackoverflow.com/questions/17995467/how-can-i-put-a-liquid-tag-highlight-in- an-ordered-list – approxiblue

+0

您在號碼前後留有空格嗎? –

回答

3

對於有這個問題的人,在下一個數字前加上額外的信息對我有幫助。

6. Install the Ruby Google API client with `gem install google-api-client`, or if you prefer in a Gemfile: 
    {% highlight ruby lineanchors %} 
    source 'https://rubygems.org' 
    gem 'google-api-client', '~> 0.9.1' 
    {% endhighlight %} 
(If you've never used [Bundler](http://bundler.io) before, you should start!) 

{:start="7"} 
7. Let's get a quick 
+0

該解決方案奏效!這是一件很煩人的事情,但它完成了工作。感謝您的回答! –

+0

這個問題是「(如果你從來沒有...」沒有縮進。 –

+0

這個問題可以這樣解決:'{:style =「list-style-type:none;」} 100.(如果你......「 –