Skip to content

Commit

Permalink
Update jekyll-toc with heading classes fix (mmistakes#1337)
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo authored and mmistakes committed Nov 6, 2017
1 parent d5c9258 commit 36629d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions _includes/toc.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% capture tocWorkspace %}
{%- comment -%}
Version 1.0.2

"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe

Usage:
Expand Down Expand Up @@ -44,10 +46,11 @@
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
{% assign _workspace = node | split: '</h' %}

{% assign _idWorkspace = _workspace[0] | split: '"' %}
{% assign html_id = _idWorkspace[1] %}
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
{% assign html_id = _idWorkspace[0] %}

{% capture _hAttrToStrip %}{{ headerLevel }} id="{{ html_id }}">{% endcapture %}
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}

{% assign space = '' %}
Expand All @@ -69,5 +72,4 @@
{% capture my_toc %}{: #{{ include.id }}}
{{ my_toc | lstrip }}{% endcapture %}
{% endif %}
{% endcapture %}{% assign tocWorkspace = '' %}
{{ my_toc | markdownify }}
{% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
12 changes: 7 additions & 5 deletions docs/_includes/toc.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% capture tocWorkspace %}
{%- comment -%}
Version 1.0.2

"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe

Usage:
Expand Down Expand Up @@ -44,10 +46,11 @@
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
{% assign _workspace = node | split: '</h' %}

{% assign _idWorkspace = _workspace[0] | split: '"' %}
{% assign html_id = _idWorkspace[1] %}
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
{% assign html_id = _idWorkspace[0] %}

{% capture _hAttrToStrip %}{{ headerLevel }} id="{{ html_id }}">{% endcapture %}
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}

{% assign space = '' %}
Expand All @@ -69,5 +72,4 @@
{% capture my_toc %}{: #{{ include.id }}}
{{ my_toc | lstrip }}{% endcapture %}
{% endif %}
{% endcapture %}{% assign tocWorkspace = '' %}
{{ my_toc | markdownify }}
{% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}

0 comments on commit 36629d1

Please sign in to comment.