I work with Jekyll and want to use it {% include... %}to include the HTML fragment in the markup file without further HTML processing, that is, it is then processed by the markup processor, as if it were only built-in HMTL.
Note. I use redcarpet markdown (and not, for example, kramdown).
Can this be handled with a Jekyll plugin?
I created a GitHub md-include-html repository with the following files that demonstrate my problem.
1. _layouts/default.htmlcontains:
<div>
{{ content }}
</div>
2. md-page.mdcontains:
layout: default
A
{% include_relative html-snippet.html %}
B
3. html-snippet.htmlcontains:
</div>
<div>
Note that I am first trying to close the div that will be presented _layouts/default.html, and then open a new div at the end.
_site/md-page.html:
<div>
<p>A</p>
<p></div>
<!-- Some arbitrary HTML for md-page.md -->
<div></p>
, , <p>...</p>.
, , -.
HTML - (. html-page.html ):
{% capture snippet_content %}
{% include_relative md-snippet.md %}
{% endcapture %}
{{ snippet_content | markdownify }}
HTML .
(- Liquid, , ), .
.
A
<markdown-off>{% include_relative html-snippet.html %}</markdown-off>
B
, , , , .
- Jekyll-? , Jekyll, .