From 72692d00a68fdd1de04749153fd56cd5a424cda4 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Tue, 8 Dec 2015 11:07:24 +0100 Subject: [PATCH] Accept nil as argument to markdown helper --- config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.rb b/config.rb index e25305a..7162320 100644 --- a/config.rb +++ b/config.rb @@ -14,9 +14,9 @@ helpers do def markdown(source=nil, single_line = nil, &block) source = capture(&block) if block_given? - html = Tilt['markdown'].new(markdown_options){ source }.render + html = Tilt['markdown'].new(markdown_options){ source.to_s }.render - single_line = !source.include?("\n") if single_line.nil? + single_line = !source.to_s.include?("\n") if single_line.nil? if single_line doc = Nokogiri::HTML::DocumentFragment.parse(html) doc.search('p').each do |node|