Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

dump <hr> in Markdown as "* * *"

  • Loading branch information...
commit af5c05d6e844ed9af32ab2440ee73647619fca63 1 parent 7a454a8
@mislav authored
Showing with 9 additions and 1 deletion.
  1. +2 −0  lib/remark/hpricot_ext.rb
  2. +7 −1 spec/hpricot_ext_spec.rb
View
2  lib/remark/hpricot_ext.rb
@@ -112,6 +112,8 @@ def to_markdown(options = {})
super.indent('> ')
when 'br'
" \n" + inner_html
+ when 'hr'
+ '* * *'
else
to_s
end
View
8 spec/hpricot_ext_spec.rb
@@ -50,7 +50,9 @@
bar <code>baz</code></p>
<p>Foo</p><br><br><p>Bar</p><br>
</div>
-
+
+ <hr>
+
<ul>
<li>First</li>
<li>Second</li>
@@ -134,5 +136,9 @@ def remark(elem, options = {})
it "should support ordered list" do
remark('ol').should == "1. First\n2. Second"
end
+
+ it "renders horizontal rule" do
+ remark('hr').should == "* * *"
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.