Jekyll Kramdown code in ordered list - number reset

Viewed 1219

I have the following code which resets the numbered list after adding a liquid code block:

...
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...

The problem is that the following renders as:


fail


The ordered list is reset, which is obviously a problem. I've looked at many posts that detail the markdown ordered list reset problem but none of them discuss liquid tags. I found another post here discussing the issue to no avail.

Here is the HTML output just in case it is necessary. The <ol> tag is clearly being broken by a <div> element produced by the liquid tag engine... and I don't know how to embed the pre block in the <ol> block...

<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>

I want to be able to put a liquid tag in an ordered list without it breaking the <ol> HTML element and resetting the numbering. Is there a way to do this?

2 Answers
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 

As @Joshua Meyers Suggests in the comments, the problem is in the last line. If you indent the line "(If you've never used Bundler before, you should start!)" the list numbers will continue.

Related