From e7b1fe1086a66b00e142493ee14d21b2736544fa Mon Sep 17 00:00:00 2001 From: gandalf3 Date: Thu, 21 Mar 2019 12:33:24 -0700 Subject: [PATCH] Have toc_only output an empty string when toc is disabled --- lib/jekyll-toc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll-toc.rb b/lib/jekyll-toc.rb index 6a7d70c..b2e508a 100644 --- a/lib/jekyll-toc.rb +++ b/lib/jekyll-toc.rb @@ -16,7 +16,7 @@ module Jekyll # Jekyll Table of Contents filter plugin module TableOfContentsFilter def toc_only(html) - return html unless toc_enabled? + return '' unless toc_enabled? ::Jekyll::TableOfContents::Parser.new(html, toc_config).build_toc end