Parse Markdown in TOC items

This commit is contained in:
Daniel Rudolf 2015-11-04 20:58:55 +01:00
parent da7ab2ecad
commit bbaa151bb3
2 changed files with 4 additions and 4 deletions

View file

@ -1,13 +1,13 @@
{% for item in toc %}
<li>
{% if item[1]._title %}
<a href="#{{ item[0] }}">{{ item[1]._title }}</a>
<a href="#{{ item[0] }}">{{ item[1]._title | markdownify | remove: '<p>' | remove: '</p>' }}</a>
<ul>
{% assign subItems = item[1] %}
{% include tocSubItems.html %}
</ul>
{% else %}
<a href="#{{ item[0] }}">{{ item[1] }}</a>
<a href="#{{ item[0] }}">{{ item[1] | markdownify | remove: '<p>' | remove: '</p>' }}</a>
{% endif %}
</li>
{% endfor %}

View file

@ -2,13 +2,13 @@
{% if subItem[0] != "_title" %}
<li>
{% if subItem[1]._title %}
<a href="#{{ subItem[0] }}">{{ subItem[1]._title }}</a>
<a href="#{{ subItem[0] }}">{{ subItem[1]._title | markdownify | remove: '<p>' | remove: '</p>' }}</a>
<ul>
{% assign subItems = subItem[1] %}
{% include tocSubItems.html %}
</ul>
{% else %}
<a href="#{{ subItem[0] }}">{{ subItem[1] }}</a>
<a href="#{{ subItem[0] }}">{{ subItem[1] | markdownify | remove: '<p>' | remove: '</p>' }}</a>
{% endif %}
</li>
{% endif %}