Improve the creation of header anchors (fix #474)
This commit is contained in:
parent
948356d7d6
commit
b44bf78f10
1 changed files with 3 additions and 1 deletions
|
@ -208,7 +208,9 @@
|
||||||
{% capture anchor %}<a href="#{{ id }}" class="anchor"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
{% capture anchor %}<a href="#{{ id }}" class="anchor"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
||||||
|
|
||||||
{% assign left = snippet | split: mark_end | first %}
|
{% assign left = snippet | split: mark_end | first %}
|
||||||
{% assign right = snippet | replace: left, '' %}
|
{% assign _start_index = left | size %}
|
||||||
|
{% assign _end_index = snippet | size | minus: 1 %}
|
||||||
|
{% assign right = snippet | slice: _start_index, _end_index %}
|
||||||
|
|
||||||
{% assign _new_content = _new_content | append: mark_start
|
{% assign _new_content = _new_content | append: mark_start
|
||||||
| append: left | append: anchor | append: mark_end | append: right
|
| append: left | append: anchor | append: mark_end | append: right
|
||||||
|
|
Loading…
Reference in a new issue