#!/usr/bin/env ruby # encoding: utf-8 BEGIN { require 'pathname' basedir = Pathname.new( __FILE__ ).dirname.parent.parent libdir = basedir + 'lib' extdir = basedir + 'ext' $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir ) $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir ) $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir ) } require 'rspec' require 'bluecloth' require 'spec/lib/helpers' require 'spec/lib/constants' require 'spec/lib/matchers' ##################################################################### ### C O N T E X T S ##################################################################### describe BlueCloth, "document with inline HTML" do include BlueCloth::TestConstants, BlueCloth::Matchers it "preserves TABLE block" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is a regular paragraph.
Foo
This is another regular paragraph. ---

This is a regular paragraph.

Foo

This is another regular paragraph.

--- end it "preserves DIV block" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is a regular paragraph.
Something
Something else. ---

This is a regular paragraph.

Something

Something else.

--- end it "preserves HRs" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is a regular paragraph.
Something else. ---

This is a regular paragraph.


Something else.

--- end it "preserves fancy HRs" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is a regular paragraph.
Something else. ---

This is a regular paragraph.


Something else.

--- end it "preserves IFRAMEs" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is a regular paragraph. Something else. ---

This is a regular paragraph.

Something else.

--- end it "preserves span-level HTML" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is some stuff with a spanned bit of text in it. And this *should* be a bit of deleted text which should be preserved, and part of it emphasized. ---

This is some stuff with a spanned bit of text in it. And this should be a bit of deleted text which should be preserved, and part of it emphasized.

--- end it "preserves block-level HTML case-insensitively" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is a regular paragraph.
Foo
This is another regular paragraph. ---

This is a regular paragraph.

Foo

This is another regular paragraph.

--- end it "preserves span-level HTML case-insensitively" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation This is some stuff with a spanned bit of text in it. And this *should* be a bit of deleted text which should be preserved, and part of it emphasized. ---

This is some stuff with a spanned bit of text in it. And this should be a bit of deleted text which should be preserved, and part of it emphasized.

--- end it "preserves HTML5 tags" do the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation The main content. ---

The main content.

--- end end