Template escaping doesn't work in included adoc files
jeff-button opened this issue · comments
HonKit version: 4.0.4
I'm using {% raw %} and {% endraw %} in several adoc files. They are removed correctly by honkit build . dist
except when included in another adoc file.
Parent Adoc
{% raw %} PARENT - this will {{ not be processed }} {% endraw %}
include::./child.adoc[]
Child Adoc
{% raw %} CHILD - this will {{ not be processed }} {% endraw %}
Html Output
<pre>PARENT - this will {{ not be processed }}</pre>
<p>{% raw %} CHILD - this will {{ not be processed }} {% endraw %}</p>
Repo
Probably, It is caused by the order of processing.
honkit/packages/honkit/src/output/generatePage.ts
Lines 50 to 86 in b723ce5
Current
- render template
- parse markup
{% raw %}
is processed by template engine. So 1 treat it.
But, include::./child.adoc[]
is asciidoc feature. So 2 treat it.
As a result, it can not process {% raw %}
in child.asoc.
I am not aware if this order can be changed.(It may breaks something)
Workaround: Probably, it can be avoided by using inclulde
tag.
{% include "./child.adoc" %}
It is processed by template engine.
That works. Thank you!