headers if there's no ignore pattern, or if the header text doesn't match the pattern. #}
            {% if not toc_ignore_pattern or not (h1.title is matching(toc_ignore_pattern)) %}
                <li><a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
                    {% if h1.children and toc_levels > 1 %}
                        <ul>
                            {% for h2 in h1.children %}
                                {% if not toc_ignore_pattern or not (h2.title is matching(toc_ignore_pattern