Skip to content

Commit

Permalink
Merge pull request #29 from allejo/hotfix/logic-improvements
Browse files Browse the repository at this point in the history
Fix logic errors on rendering list item classes
  • Loading branch information
allejo authored Jan 11, 2020
2 parents 86254a9 + 85c533f commit a4fd66f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
Gemfile.lock
vendor
Expand Down
8 changes: 4 additions & 4 deletions _includes/toc.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% capture tocWorkspace %}
{% comment %}
Version 1.0.8
Version 1.0.9
https://github.com/allejo/jekyll-toc

"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
Expand Down Expand Up @@ -75,16 +75,16 @@
{% assign space = space | prepend: ' ' %}
{% endfor %}

{% unless include.item_class == blank %}
{% if include.item_class and include.item_class != blank %}
{% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
{% endunless %}
{% endif %}

{% capture heading_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
{% capture my_toc %}{{ my_toc }}
{{ space }}{{ listModifier }} {{ listItemClass }} [{{ heading_body | replace: "|", "\|" }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
{% endfor %}

{% if include.class %}
{% if include.class and include.item_class != blank %}
{% capture my_toc %}{:.{{ include.class }}}
{{ my_toc | lstrip }}{% endcapture %}
{% endif %}
Expand Down

0 comments on commit a4fd66f

Please sign in to comment.