Parse Markdown in TOC items
This commit is contained in:
parent
da7ab2ecad
commit
bbaa151bb3
2 changed files with 4 additions and 4 deletions
|
@ -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 %}
|
|
@ -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 %}
|
||||
|
|
Loading…
Add table
Reference in a new issue