-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from allejo/feature/no-anchor-headings
Don't render empty anchors for headings without IDs
- Loading branch information
Showing
4 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# https://github.com/allejo/jekyll-toc/issues/32 | ||
--- | ||
|
||
{% capture markdown %} | ||
## Heading 2.1 | ||
|
||
<h2>Heading 2.2 (no link)</h2> | ||
|
||
### Heading 2.2.1 | ||
|
||
<h2 id="heading-23" class="no_toc">Heading 2.3</h2> | ||
|
||
## Heading 2.4 | ||
|
||
<h3 id="super-toast">Heading 2.4.1</h3> | ||
{% endcapture %} | ||
{% assign text = markdown | markdownify %} | ||
|
||
{% include toc.html html=text %} | ||
|
||
<!-- /// --> | ||
|
||
<ul> | ||
<li> | ||
<a href="#heading-21">Heading 2.1</a> | ||
</li> | ||
<li> | ||
Heading 2.2 (no link) | ||
<ul> | ||
<li> | ||
<a href="#heading-221">Heading 2.2.1</a> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
<a href="#heading-24">Heading 2.4</a> | ||
<ul> | ||
<li> | ||
<a href="#super-toast">Heading 2.4.1</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
# https://github.com/allejo/jekyll-toc/issues/32 | ||
--- | ||
|
||
{% capture markdown %} | ||
## Sample Usage | ||
|
||
<div> | ||
<h1 class="page-title">My Awesome Example Page</h1> | ||
<h2 class="page-subtitle">With an awesome subtitle</h2> | ||
</div> | ||
|
||
### Known Problems | ||
|
||
Lots! | ||
|
||
### Resources | ||
|
||
#### Paid | ||
|
||
#### Free | ||
{% endcapture %} | ||
{% assign text = markdown | markdownify %} | ||
|
||
{% include toc.html html=text skipNoIDs=true %} | ||
|
||
<!-- /// --> | ||
|
||
<ul> | ||
<li> | ||
<a href="#sample-usage">Sample Usage</a> | ||
<ul> | ||
<li> | ||
<a href="#known-problems">Known Problems</a> | ||
</li> | ||
<li> | ||
<a href="#resources">Resources</a> | ||
<ul> | ||
<li> | ||
<a href="#paid">Paid</a> | ||
</li> | ||
<li> | ||
<a href="#free">Free</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> |