What's the deal with "Found a Liquid block containing the excerpt separator "\n\n"."

The reason for the warning is not because of Markdown, but because of the Liquid block tag.
When you have a Liquid block containing a blank line in the first paragraph, the default excerpt will not have valid Liquid construct because the closing tag of the block will not be included.

Consider the following example as a document’s content:

Lorem ipsum dolor
{% for foo in site.foobar %}

  {{ foo.title }}
{% endfor %}

The extracted unrendered excerpt object from the above doc, by default would just contain:

Lorem ipsum dolor
{% for foo in site.foobar %}

which is an invalid Liquid syntax and would abort the whole build when the excerpt is being rendered.
To overcome this, Jekyll inserts the closing tag to appease Liquid which makes the above unrendered excerpt content to be:

Lorem ipsum dolor
{% for foo in site.foobar %}
{% endfor %}

The build proceeds without any issue but the rendered excerpt won’t be as expected by the author.
Hence Jekyll issues a warning that it has interfered on the author’s behalf but cannot guarantee a satisfactory output and to do the needful by opting for a different excerpt-separator or changing the placement of the blank line.

1 Like