Skip to content

Commit ff68024

Browse files
committed
Merge pull request #765 from bclennox/redcarpet_tables
Turning on :tables by default for RedcarpetCompat.
2 parents 156ca2c + ec644fc commit ff68024

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

lib/yard/templates/helpers/html_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def html_markup_markdown(text)
6161
provider.new(text, :autolink).to_html
6262
elsif provider.to_s == 'RedcarpetCompat'
6363
provider.new(text, :no_intraemphasis, :gh_blockcode,
64-
:fenced_code, :autolink).to_html
64+
:fenced_code, :autolink, :tables).to_html
6565
else
6666
provider.new(text).to_html
6767
end

spec/templates/helpers/html_helper_spec.rb

+20
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,26 @@ def options
166166
htmlify('{http://example.com}', :markdown).chomp.should =~
167167
%r{<p><a href="http://example.com".*>http://example.com</a></p>}
168168
end
169+
170+
it "should create tables (markdown specific)" do
171+
log.enter_level(Logger::FATAL) do
172+
unless markup_class(:markdown).to_s == "RedcarpetCompat"
173+
pending 'This test depends on a markdown engine that supports tables'
174+
end
175+
end
176+
177+
markdown = <<-EOF.strip
178+
City | State | Country
179+
--------|-------|--------
180+
Raleigh | NC | US
181+
Seattle | WA | US
182+
EOF
183+
184+
html = htmlify(markdown, :markdown)
185+
html.should =~ %r{<table>}
186+
html.should =~ %r{<td>City</td>}
187+
html.should =~ %r{<td>NC</td>}
188+
end
169189
end
170190

171191
describe "#link_object" do

0 commit comments

Comments
 (0)