How to skip fragments of code in Matrix? I fell like I'm missing an obvious thing, how to end block before I will start the new one?

{% for block in entry.myMatrixField %}

{% if block.type == "heading" %}

    &lt;h3&gt;{{ block.heading }}&lt;/h3&gt;
    &lt;h1&gt;I don't want this text to be part of heading block&lt;/h1&gt;

{% elseif block.type == "text" %}

    {{ block.text|markdown }}

{% endif %}

{% endfor %}


edit: here is my real code:

{# "Check" section #}
                    &lt;section class="wrapper style1 container special"&gt;
                        &lt;div class="row"&gt;
{# "Check" block #}
            {% elseif block.type == "check" %}
                            &lt;div class="4u 12u(narrower)"&gt;
                                &lt;section&gt;
                                    &lt;span class="icon featured fa-check"&gt;&lt;/span&gt;
                                    &lt;header&gt;
                                        &lt;h3&gt;{{ block.checkHeader }}&lt;/h3&gt;
                                    &lt;/header&gt;
                                    &lt;p&gt;{{ block.checkText }}&lt;/p&gt;
                                &lt;/section&gt;
                            &lt;/div&gt;
{# In this place block "check" should end #}
                        &lt;/div&gt;
                    &lt;/section&gt;
{# end of "check" section#}

{#beginning of "gallery section" #}
                        &lt;section class="wrapper style3 container special"&gt;
                        &lt;header class="major"&gt;
                            &lt;h2&gt;Next look at this &lt;strong&gt;cool stuff&lt;/strong&gt;&lt;/h2&gt;
                        &lt;/header&gt;

                        &lt;div class="row"&gt;
{# "gallery" block #}
            {% elseif block.type == "gallery" %}
                            &lt;div class="6u 12u(narrower)"&gt;

                                &lt;section&gt;
                                    &lt;a href="#" class="image featured"&gt;&lt;img src="someimagesoon.jpg" alt="" /&gt;&lt;/a&gt;
                                    &lt;header&gt;
                                        &lt;h3&gt;{{ block.imageHeader }}&lt;/h3&gt;
                                    &lt;/header&gt;
                                    &lt;p&gt;{{ block.imageText }}&lt;/p&gt;
                                &lt;/section&gt;
{# In this place block "gallery" should end #}
                            &lt;/div&gt;
                        &lt;/div&gt;

                        &lt;footer class="major"&gt;
                            &lt;ul class="buttons"&gt;
                                &lt;li&gt;&lt;a href="#" class="button"&gt;See More&lt;/a&gt;&lt;/li&gt;
                            &lt;/ul&gt;
                        &lt;/footer&gt;

                    &lt;/section&gt;

            &lt;/article&gt;
Your question is rather vaguely but if I'm right:

You could put an "if" statement around your "h1" element like,

{% if loop.first %}&lt;h1&gt;This text will only be used if the lightswitch is active&lt;/h1&gt;{% endif %}


Or add a field to the block. Preferably a lightswitch. Which if enabled will show the H1 tag and wont if you dont activate it.

{% if block.lightSwitch %}&lt;h1&gt;This text will only be used in the first loop&lt;/h1&gt;{% endif %}