RemoveΒΆ

Processor name: remove

The remove processor is a post-processor that searches the document for remove HTML-elements (i.e. <remove>...</remove>) and removes them from the document leaving the content unchanged. This is useful when creating HTML-templates as they can be used to add multiple siblings to a parent element that are not valid HTML, allowing the document to be parsed as a valid HTML-document up until their removal.

Note

The remove processor does not remove the content between the remove element tags, but instead only removes the tag itself.

For example the Conditional processors default HTML template, as follows, does not produce valid HTML and so is placed within a remove element so that Verto can add it to the element tree.

<remove>
{% autoescape false -%}
{{ "{% if " }}{{ if_expression }}{{ " %}" }}
{{ if_content }}
{% for elif_expression, elif_content in elifs.items() -%}
{{ "{% elif " }}{{ elif_expression }}{{ " %}" }}
{{ elif_content }}
{% endfor -%}
{% if has_else -%}
{{ "{% else %}" }}
{{ else_content }}
{% endif -%}
{{ "{% endif %}" }}
{% endautoescape -%}
</remove>

Therefore a Markdown document like:

<div>
<remove>
<p>Content in here.</p>
{{ Django Variable }}
<p>Something about the variable.</p>
</remove>
</div>

When parsed with Verto will produce the output:

<div>
<p>Content in here.</p>
{{ Django Variable }}
<p>Something about the variable.</p>
</div>