diff --git a/extras/markdowner.rb b/extras/markdowner.rb index 82b750f..597ba70 100644 --- a/extras/markdowner.rb +++ b/extras/markdowner.rb @@ -13,35 +13,38 @@ class Markdowner args.push :no_image end - html = RDiscount.new(text.to_s, *args).to_html + ng = Nokogiri::HTML(RDiscount.new(text.to_s, *args).to_html) - # change
hello there italics and bold!
\n" + "hello there italics and bold!
" end it "turns @username into a link if @username exists" do User.make!(:username => "blahblah") Markdowner.to_html("hi @blahblah test").should == - "hi @blahblah test
\n" + "hi @blahblah test
" Markdowner.to_html("hi @flimflam test").should == - "hi @flimflam test
\n" - end - - it "moves punctuation outside of auto-generated links" do - Markdowner.to_html("hi http://example.com/a! test").should == - "hi http://example.com/a! test
\n" + "hi @flimflam test
" end # bug#209 it "keeps punctuation inside of auto-generated links when using brackets" do Markdowner.to_html("hihi http://example.com/a. test
\n" + "hi " << + "http://example.com/a. test
" end # bug#242 @@ -34,11 +28,11 @@ describe Markdowner do User.make!(:username => "blahblah") Markdowner.to_html("hi http://example.com/@blahblah/ test").should == - "hi http://example.com/@blahblah
\n" + "hi " << + "http://example.com/@blahblah/ test
" Markdowner.to_html("hi [test](http://example.com/@blahblah/)").should == - "hi test
\n" + "hi " << + "test
" end end