#!/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( libdir ) unless $LOAD_PATH.include?( libdir ) $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir ) } require 'spec' 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 MathML block" do pending "discount doesn't support this, it explicitly matches block-level HTML elements only" the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation Examples -------- Now that we have met some of the key players, it is time to see what we can do. Here are some examples and comments which illustrate the use of the basic layout and token elements. Consider the expression x2 + 4x + 4 = 0. A basic MathML presentation encoding for this would be: x 2 + 4 x + 4 = 0 This encoding will display as you would expect. However, if we were interested in reusing this expression in unknown situations, we would likely want to spend a little more effort analyzing and encoding the logical expression structure. ---

Examples

Now that we have met some of the key players, it is time to see what we can do. Here are some examples and comments which illustrate the use of the basic layout and token elements. Consider the expression x2 + 4x + 4 = 0. A basic MathML presentation encoding for this would be:

x 2 + 4 x + 4 = 0

This encoding will display as you would expect. However, if we were interested in reusing this expression in unknown situations, we would likely want to spend a little more effort analyzing and encoding the logical expression structure.

--- 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 end