diff --git a/_includes/toc.html b/_includes/toc.html index 8c71007..80d8bdb 100644 --- a/_includes/toc.html +++ b/_includes/toc.html @@ -179,4 +179,4 @@ {% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %} {% endif %} {% endif %} -{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc }} +{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc -}} diff --git a/_tests/allowCheckEmptyToc.md b/_tests/allowCheckEmptyToc.md new file mode 100644 index 0000000..710b9a4 --- /dev/null +++ b/_tests/allowCheckEmptyToc.md @@ -0,0 +1,15 @@ +--- +# See https://github.com/allejo/jekyll-toc/pull/60 +--- + +{% capture jekyll_toc %}{% include toc.html html="" %}{% endcapture %} + +{% if jekyll_toc == "" -%} +
Success
+{%- else -%} +Failure
+{%- endif %} + + + +Success