File size: 1,373 Bytes
2deab8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{# Block partial: note (standalone or inline-parts) #}
{% if block.data.inline and block.data.parts %}
<div class="{{ block.css_class | default('hb-note') }}">
    {% for part in block.data.parts %}
    {% if part.style == 'red_bold' %}
    <strong class="hb-note-keyword">{{ part.text | e }}</strong>
    {% elif part.style == 'bold' %}
    <strong>{{ part.text | e }}</strong>
    {% elif part.style == 'italic' %}
    <em>{{ part.text | e }}</em>
    {% else %}
    {{ part.text | e }}
    {% endif %}
    {% endfor %}
</div>
{% else %}
<div class="{{ block.css_class | default('hb-note') }}">
    {% set text = block.data.text | default('') %}
    {# Highlight NOTE / ONLY IF keywords in bold + red; rest stays bold via CSS #}
    {% if text.upper().startswith('NOTE:') %}
    <span class="hb-note-keyword">NOTE:</span> {{ text[5:] | e }}
    {% elif text.upper().startswith('NOTE ') %}
    <span class="hb-note-keyword">NOTE</span> {{ text[4:] | e }}
    {% elif text.upper().startswith('NOTE') %}
    <span class="hb-note-keyword">NOTE</span>{{ text[4:] | e }}
    {% elif text.upper().startswith('ONLY IF:') %}
    <span class="hb-note-keyword">ONLY IF:</span> {{ text[8:] | e }}
    {% elif text.upper().startswith('ONLY IF') %}
    <span class="hb-note-keyword">ONLY IF</span> {{ text[7:] | e }}
    {% else %}
    {{ text | e }}
    {% endif %}
</div>
{% endif %}