Split block resolver into its own file

This commit is contained in:
Evie Viau-Chow-Stuart 2023-02-07 03:37:29 -08:00
parent a55eff173b
commit 1b032f98ff
Signed by: evie
GPG key ID: 928652CDFCEC8099
3 changed files with 17 additions and 28 deletions

View file

@ -23,19 +23,7 @@
{% endif -%}
{% for content_block in content_blocks %}
{% match content_block %}
{% when BlockTypes::HR %}
<hr />
{% when BlockTypes::PARAGRAPH { text } %}
<p>{{ text }}</p>
{% when BlockTypes::MARKDOWN { content } %}
{{ content|markdown }}
{% when BlockTypes::HTML { content } %}
{{ content|safe }}
{% when BlockTypes::HEADER { text, size } %}
<h{{size}}>{{text}}</h{{size}}>
{% else %}
<b>UNSUPPORTED block type here!</b>
{% endmatch %}
{% include "resolve_content.html" %}
{% endfor %}
{% endblock %}

View file

@ -34,20 +34,7 @@
<br />
{% for content_block in content_blocks %}
{% match content_block %}
{% when BlockTypes::HR %}
<hr />
{% when BlockTypes::PARAGRAPH { text } %}
<p>{{ text }}</p>
{% when BlockTypes::MARKDOWN { content } %}
{{ content|markdown }}
{% when BlockTypes::HTML { content } %}
{{ content|safe }}
{% when BlockTypes::HEADER { text, size } %}
<h{{size}}>{{text}}</h{{size}}>
{% else %}
<b>UNSUPPORTED block type here!</b>
{% endmatch %}
{% include "resolve_content.html" %}
{% endfor %}
<br />

View file

@ -0,0 +1,14 @@
{% match content_block %}
{% when BlockTypes::HR %}
<hr />
{% when BlockTypes::PARAGRAPH { text } %}
<p>{{ text }}</p>
{% when BlockTypes::MARKDOWN { content } %}
{{ content|markdown }}
{% when BlockTypes::HTML { content } %}
{{ content|safe }}
{% when BlockTypes::HEADER { text, size } %}
<h{{size}}>{{text}}</h{{size}}>
{% else %}
<b>UNSUPPORTED block type here!</b>
{% endmatch %}