<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -17,4 +17,10 @@ module RedCloth
   # for an example.
   module Ast
   end
+end
+
+class String
+  def to_sexp
+    self
+  end
 end
\ No newline at end of file</diff>
      <filename>lib/redcloth/ast.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module RedCloth
   module Ast
-    class Element &lt; Inline
+    class Element
       attr_reader :contained_elements
       attr_reader :type
       
@@ -11,7 +11,7 @@ module RedCloth
       end
       
       def to_sexp
-        [type, @opts, contents_to_sexp]
+        [type, @opts, contained_elements.map {|e| e.to_sexp }]
       end
       
       def accept(visitor)</diff>
      <filename>lib/redcloth/ast/element.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,12 +2,12 @@ module RedCloth
   module Ast
     class ListItem
       
-      def initialize(opts, inline)
-        @opts, @inline = opts, inline
+      def initialize(opts, contained_elements)
+        @opts, @contained_elements = opts, contained_elements
       end
       
       def to_sexp
-        [:list_item, @opts, @inline.to_sexp]
+        [:list_item, @opts, @contained_elements.map {|e| e.to_sexp }]
       end
       
     end</diff>
      <filename>lib/redcloth/ast/list_item.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ module RedCloth
             def build(filter)
               Ast::Element.new(
                 {:type =&gt; :bold},
-                contents.all_inline_elements.map {|e| e.build(filter) }
+                contents.build(filter)
               )
             end
           }</diff>
      <filename>lib/redcloth/parser/inline/bold.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -10,9 +10,18 @@ module RedCloth
         punct
         more_elements:(!li_end inline_spaces inline_element punct)* {
           def build(filter)
-            Ast::Inline.new(
-              all_inline_elements.map {|e| e.build(filter) }
-            )
+            all_inline_elements.map {|e| e.build(filter) }.inject([]) do |a, e|
+              if e.is_a?(String)
+                if a.last.is_a?(String)
+                  a.last &lt;&lt; e
+                else
+                  a &lt;&lt; e unless e.blank?
+                end
+              else
+                a &lt;&lt; e
+              end
+              a
+            end
           end
           def all_inline_elements
             [element_1, punct] + more_elements.elements.map {|e| e.elements }.flatten.reject do |e|</diff>
      <filename>lib/redcloth/parser/inline/common_inline.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ module RedCloth
             def build(filter)
               Ast::Element.new(
                 {:type =&gt; :strong},
-                contents.all_inline_elements.map {|e| e.build(filter) }
+                contents.build(filter)
               )
             end
           }</diff>
      <filename>lib/redcloth/parser/inline/strong.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -12,42 +12,46 @@ module RedCloth
         @parser.parse_or_fail(string)
       end
       
+      def parsed_sexp(string)
+        parse(string).map {|e| e.to_sexp}
+      end
+      
       ### plain text ###
       
       it &quot;should parse a plain-text phrase&quot; do
-        parse(&quot;Just plain text.&quot;).to_sexp.should ==
+        parsed_sexp(&quot;Just plain text.&quot;).should ==
           [&quot;Just plain text.&quot;]
       end
       
       it &quot;should parse a phrase with asterisks that is not a strong phrase&quot; do
-        parse(&quot;yes * we * can&quot;).to_sexp.should ==
+        parsed_sexp(&quot;yes * we * can&quot;).should ==
          [&quot;yes * we * can&quot;]
       end
 
       it &quot;should parse a phrase that is not a strong because it has space at the end&quot; do
-        parse(&quot;yeah *that's * it!&quot;).to_sexp.should ==
+        parsed_sexp(&quot;yeah *that's * it!&quot;).should ==
          [&quot;yeah *that's * it!&quot;]
       end
       
       ### strong ###
       
       it &quot;should parse a strong phrase&quot; do
-        parse(&quot;*strong phrase*&quot;).to_sexp.should ==
+        parsed_sexp(&quot;*strong phrase*&quot;).should ==
           [[:strong, {}, [&quot;strong phrase&quot;]]]
       end
       
       it &quot;should parse a strong phrase surrounded by plain text&quot; do
-        parse(&quot;plain *strong phrase* plain&quot;).to_sexp.should ==
+        parsed_sexp(&quot;plain *strong phrase* plain&quot;).should ==
           [&quot;plain &quot;, [:strong, {}, [&quot;strong phrase&quot;]], &quot; plain&quot;]
       end
       
       it &quot;should allow a strong phrase at the end of a sentence before punctuation&quot; do
-        parse(&quot;Are you *veg*an*?&quot;).to_sexp.should ==
+        parsed_sexp(&quot;Are you *veg*an*?&quot;).should ==
           [&quot;Are you &quot;, [:strong, {}, [&quot;veg*an&quot;]], &quot;?&quot;]
       end
       
       it &quot;should parse a bold phrase inside a strong phrase&quot; do
-        parse(&quot;*this is **bold** see*&quot;).to_sexp.should ==
+        parsed_sexp(&quot;*this is **bold** see*&quot;).should ==
           [[:strong, {}, [
             &quot;this is &quot;,
             [:bold, {}, [&quot;bold&quot;]],
@@ -56,7 +60,7 @@ module RedCloth
       
       it &quot;should parse an emphasized phrase inside a strong phrase&quot; do
         pending
-        parse(&quot;*_em in strong_*&quot;).to_sexp.should ==
+        parsed_sexp(&quot;*_em in strong_*&quot;).should ==
           [[:strong, {}, [
             [:em, {}, [&quot;em in strong&quot;]]]]]
       end
@@ -65,13 +69,13 @@ module RedCloth
       
       it &quot;should parse an emphasized phrase&quot; do
         pending
-        parse(&quot;_emphasized_&quot;).to_sexp.should ==
+        parsed_sexp(&quot;_emphasized_&quot;).should ==
           [[:em, {}, [&quot;emphasized&quot;]]]
       end
       
       it &quot;should parse a strong phrase inside an emphasized phrase&quot; do
         pending
-        parse(&quot;_*strong in em*_&quot;).to_sexp.should ==
+        parsed_sexp(&quot;_*strong in em*_&quot;).should ==
           [[:em, {}, [
             [:strong, {}, [&quot;strong in em&quot;]]]]]
       end
@@ -79,22 +83,22 @@ module RedCloth
       ### bold ###
       
       it &quot;should parse a bold phrase&quot; do
-        parse(&quot;**bold phrase**&quot;).to_sexp.should ==
+        parsed_sexp(&quot;**bold phrase**&quot;).should ==
           [[:bold, {}, [&quot;bold phrase&quot;]]]
       end
       
       it &quot;should parse a bold phrase surrounded by plain text&quot; do
-        parse(&quot;plain **bold phrase** plain&quot;).to_sexp.should ==
+        parsed_sexp(&quot;plain **bold phrase** plain&quot;).should ==
           [&quot;plain &quot;, [:bold, {}, [&quot;bold phrase&quot;]], &quot; plain&quot;]
       end
       
       it &quot;should allow a bold phrase at the end of a sentence before punctuation&quot; do
-        parse(&quot;Are you **veg*an**?&quot;).to_sexp.should ==
+        parsed_sexp(&quot;Are you **veg*an**?&quot;).should ==
           [&quot;Are you &quot;, [:bold, {}, [&quot;veg*an&quot;]], &quot;?&quot;]
       end
       
       it &quot;should parse a strong phrase inside a bold phrase&quot; do
-        parse(&quot;**this is *strong* see**&quot;).to_sexp.should ==
+        parsed_sexp(&quot;**this is *strong* see**&quot;).should ==
           [[:bold, {}, [
             &quot;this is &quot;,
             [:strong, {}, [&quot;strong&quot;]],
@@ -103,7 +107,7 @@ module RedCloth
       
       it &quot;should parse an emphasized phrase inside a bold phrase&quot; do
         pending
-        parse(&quot;**_em in bold_**&quot;).to_sexp.should ==
+        parsed_sexp(&quot;**_em in bold_**&quot;).should ==
           [[:bold, {}, [
             [:em, {}, [&quot;em in bold&quot;]]]]]
       end</diff>
      <filename>spec/redcloth/parser/inline_parser_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/redcloth/ast/inline.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>1726e0b17be4ee1fbb6a901fd37a2d083e21e66c</id>
    </parent>
  </parents>
  <author>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </author>
  <url>http://github.com/jgarber/redcloth-treetop/commit/678c92b9c86ef7be0a703d4921f85c158ed791b9</url>
  <id>678c92b9c86ef7be0a703d4921f85c158ed791b9</id>
  <committed-date>2009-07-02T05:28:03-07:00</committed-date>
  <authored-date>2009-07-02T05:28:03-07:00</authored-date>
  <message>Remove Inline from the AST.  Simplifies things a lot.</message>
  <tree>039cd3db10519f68ef62efd4f63adc51c837c3b3</tree>
  <committer>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </committer>
</commit>
