0

Using Jekyll, I have this file:

#_posts/2015-06-20-post.textile
blablabla:

{% highlight bash  %}
$ ruby example_blocks_1.rb
[0, 2, 4, 6]
hello world
hello world
hello world
hello world
hello world
hello world
{% endhighlight  %} 

bla bla bla

this is the html produced:

<p>blablabla:</p>
<p><div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="gp">$ </span>ruby example_blocks_1.rb
<span class="o">[</span>0, 2, 4, 6]
hello world
hello world
hello world
hello world
hello world
hello world</code></pre></div></p>
<p>blablabla</p>

If you put the html in a validator like this: https://validator.w3.org/nu/ you can see:

Error: No p element in scope but a p end tag seen.

It seems html is not correct, you can see the reference here: http://www.w3.org/TR/html401/struct/text.html#h-9.3.1 Infact p tag can't contain block-level tags

Jekyll produce html for me and I can't fix the behavior. It seems a bug.

this is my _config.yml

markdown: kramdown
highlighter: rouge

Can you help me?

user1066183
  • 2,444
  • 4
  • 28
  • 57

1 Answers1

0

Solved. The problem was the white space after the

}

Example:

{% endhighlight  %} 

there are 2 spaces before last % and after the last } there are others white spaces (we can't see them but they are present)

user1066183
  • 2,444
  • 4
  • 28
  • 57