require 'text_utils/spec_helper' describe "Markdown" do include RSpec::TextUtilsHelper before do markdown = TextUtils::Markdown.new @processor = TextUtils::CustomMarkdown.new markdown @options = {format: :markdown} end it_should_behave_like 'text processor' it "should apply markup inside of html elements (from error)" do html = < ![img] [img]: /some_link HTML to_doc(html).css('.right img').size.should == 1 end it "should leave existing links intact" do doc = to_doc(%{http://some_domain.com}) doc.css('a').size.should == 1 doc.css('a').first['href'].should == "http://some_domain.com" end describe 'image box' do it "should use simplifyed syntax for image boxes (!![img_thumb] => [![img_thumb]][img_full_version])" do html = <\s*line 1<\/p>\n

line 2<\/p>\n

line 3\s*<\/p>.?/ # end end