1
0
mirror of https://github.com/meineerde/holgerjust.de.git synced 2026-02-21 11:02:03 +00:00

Accept nil as argument to markdown helper

This commit is contained in:
Holger Just 2015-12-08 11:07:24 +01:00
parent b92dd318cd
commit 72692d00a6

View File

@ -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|