{# needs sdoc_entity, see README.txt #}
{%- if sdoc_entity.reserved_title %}
  <sdoc-node-title
    data-level="{{ sdoc_entity.context.title_number_string }}"
  >

    {%- set node_view=sdoc_entity.get_requirement_style_mode() -%}
    {# Table-like: 'Inline' | 'Simple' | 'Table' | 'Zebra' #}
    {# Doc-like: 'Narrative' #}
    {%- set title_has_h_level = true
        if sdoc_entity.is_composite
        and node_view not in ['table', 'zebra', 'simple', 'inline']
    -%}

    {%- set h_level = sdoc_entity.ng_level + 1
        if sdoc_entity.ng_level < 6
        else 6 -%}

    {% if title_has_h_level %}<h{{ h_level }}>{% endif %}

    {#- initiate the accumulating variable -#}
    {%- set field_content_ = "" -%}

    {%- if title_number is true -%}
      {%- if sdoc_entity.context.title_number_string %}
        {#- add title 'number' part to the accumulator -#}
        {%- set field_content_ = field_content_ + sdoc_entity.context.title_number_string + ".&nbsp;"|safe -%}
      {%- endif -%}
    {%- endif -%}

    {%- set title = sdoc_entity.reserved_title -%}
    {%- if title is not none -%}
      {#- add title 'value' part to the accumulator -#}
      {%- set field_content_ = field_content_ + title -%}
    {%- endif -%}

    {#- pass the variable to the component -#}
    {%- with field_content = field_content_ %}
      {%- include "components/field/index.jinja" -%}
    {%- endwith -%}

    {% if title_has_h_level %}</h{{ h_level }}>{% endif %}
  </sdoc-node-title>
{%- endif %}
