require "spec_helper" describe Markdowner do it "parses simple markdown" do Markdowner.to_html("hello there *italics* and **bold**!").should == "
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
" Markdowner.to_html("hi @flimflam test").should == "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
" end # bug#242 it "does not expand @ signs inside urls" do User.make!(:username => "blahblah") Markdowner.to_html("hi http://example.com/@blahblah/ test").should == "hi " << "http://example.com/@blahblah/ test
" Markdowner.to_html("hi [test](http://example.com/@blahblah/)").should == "hi " << "test
" end it "correctly adds nofollow" do Markdowner.to_html("[ex](http://example.com)").should == "" Markdowner.to_html("[ex](//example.com)").should == "" Markdowner.to_html("[ex](/u/abc)").should == "" end end