<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'planet/config'
+require 'html5/tokenizer'
 
 class PlanetFormatter
 
@@ -8,7 +9,27 @@ class PlanetFormatter
 
   def plain(value)
     #TODO add HTML stripper
-    return value
+    tokenizer = HTML5::HTMLTokenizer.new(value)
+    line = &quot;&quot;
+    tokenizer.each { |t| 
+#      puts &quot;PLAIN: token, type=#{t[:type]}, data=#{t[:data]}, name=#{t[:name]}\n&quot;
+ 
+                    case t[:type]
+                    when :StartTag, :EndTag, :EmptyTag, :Comment 
+                      next
+                    when :SpaceCharacters
+                      line &lt;&lt; t[:data]
+                    when :Characters
+                      line &lt;&lt; t[:data]
+                    when :ParseError
+                      puts &quot;PLAIN: parse error, data=#{t[:data]}, name=#{t[:name]}\n&quot;
+                      puts &quot;PLAIN: parse error, value=#{value}\n&quot;
+                      line &lt;&lt; value
+                    else
+                      puts &quot;PLAIN: uncaught type #{t[:type]}\n&quot;
+                    end
+                  }
+    return line
   end
   
   def string(value)
@@ -18,14 +39,18 @@ class PlanetFormatter
   
   def planet_date(value)
       df = Planet.config['Planet']['date_format']
-      df = &quot;%B %d, %Y %I:%M %p&quot; unless df
-      return value ? Time.parse(value).gmtime.strftime(df): nil
+      df ||= &quot;%B %d, %Y %I:%M %p&quot;
+      t = value ? Time.parse(value).gmtime.strftime(df): nil
+      t.gsub!('&quot;', '')
+      return t
   end
   
   def new_date(value)
       ndf = Planet.config['Planet']['new_date_format']
-      ndf = &quot;%B %d, %Y %I:%M %p&quot; unless ndf
-      return value ? Time.parse(value).gmtime.strftime(ndf): nil
+      ndf ||= &quot;%B %d, %Y %I:%M %p&quot;
+      t = value ? Time.parse(value).gmtime.strftime(ndf): nil
+      t.gsub!('&quot;', '')
+      return t
   end
 
   def rfc822(value)</diff>
      <filename>planet/formatter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,10 +24,10 @@ class HamlFormatter &lt; PlanetFormatter
     out['logo'] = string(f.logo) if f.logo
     out['message'] = string(f.message) if f.message
     out['name'] = string(f.name) if f.name
-    out['rights'] = string(f.rights) if f.rights
-    out['subtitle'] = string(f.subtitle) if f.subtitle
-    out['title'] = string(f.title) if f.title
-    out['title_plain'] = plain(f.title) if f.title
+    out['rights'] = string(f.rights) unless f.rights.size == 0
+    out['subtitle'] = string(f.subtitle) unless f.subtitle.size == 0
+    out['title'] = string(f.title) unless f.title.size == 0
+    out['title_plain'] = plain(f.title) unless f.title.size == 0
     out['url'] = string(f.url) if f.url
     return out
   end
@@ -77,7 +77,7 @@ class HamlFormatter &lt; PlanetFormatter
     out['published_822'] = rfc822(e.published) if e.published
     out['published_iso'] = rfc3399(e.published) if e.published
     out['rights'] = string(e.rights) unless e.rights.size == 0
-    out['source'] = string(e.source) if e.source
+    out['source'] = string(e.source.name) if e.source.name
     out['summary_language'] = string(e.summary_detail.language) if e.summary_detail.language rescue nil
     out['title'] = string(e.title) unless e.title.size == 0
     out['title_language'] = string(e.title_detail.language) if e.title_detail.language rescue nil
@@ -199,10 +199,10 @@ class HamlFormatter &lt; PlanetFormatter
     result &lt;&lt; &quot;logo: #{f['logo']}\n&quot; if f['logo']
     result &lt;&lt; &quot;message: #{f['message']}\n&quot; if f['message']
     result &lt;&lt; &quot;name: #{f['name']}\n&quot; if f['name']
-    result &lt;&lt; &quot;rights: #{f['rights']}\n&quot; if f['rights'].length &gt; 0
-    result &lt;&lt; &quot;subtitle: #{f['subtitle']}\n&quot; if f['subtitle'].length &gt; 0
-    result &lt;&lt; &quot;title: #{f['title']}\n&quot; if f['title'].length &gt; 0
-    result &lt;&lt; &quot;title_plain: #{f['title']}\n&quot; if f['title'].length &gt; 0
+    result &lt;&lt; &quot;rights: #{f['rights']}\n&quot; if f['rights']
+    result &lt;&lt; &quot;subtitle: #{f['subtitle']}\n&quot; if f['subtitle']
+    result &lt;&lt; &quot;title: #{f['title']}\n&quot; if f['title']
+    result &lt;&lt; &quot;title_plain: #{f['title']}\n&quot; if f['title']
     result &lt;&lt; &quot;................................\n\n&quot;
     return result
   end</diff>
      <filename>planet/hamlformatter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -71,7 +71,7 @@ class HamlTestCase &lt; Test::Unit::TestCase
         when /Description:\s*(.*?)\s*; Expect:\s*(.*)\s*/
           desc = TestCaseConverter.python2ruby($2, file)
           Planet.config.read file
-          doc = Planet.harvest('test/data/filter/haml/new_channel.xml')
+          doc = Planet.harvest('test/data/filter/haml/id.xml')
           output = HamlFormatter.new.haml_info(doc)
  
           # copy haml hash to environment</diff>
      <filename>test/haml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ feed_timeout = 30
 # items_per_page: How many items to put on each page
 template_files = index.html.haml validate.html.xslt atom.xml.xslt rss10.xml.haml
 items_per_page = 50
-date_format = &quot;%a %b $d $H:%M:%S %Y&quot;
+date_format = &quot;%a %b %d %H:%M:%S %Y&quot;
 new_date_format = &quot;%A, %d %B %Y&quot;
 filters = foo
 </diff>
      <filename>themes/intertwingly/basic.ini</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>127bdf5d62b9f25fa140dc9b73294e99fbe87d71</id>
    </parent>
  </parents>
  <author>
    <name>Jim Holt</name>
    <email>jim.holt3@gmail.com</email>
  </author>
  <url>http://github.com/joshu/mars/commit/f09cbe485c4ded878a85ae29e47775468404c307</url>
  <id>f09cbe485c4ded878a85ae29e47775468404c307</id>
  <committed-date>2008-04-20T14:37:57-07:00</committed-date>
  <authored-date>2008-04-20T14:37:57-07:00</authored-date>
  <message>Hack for quote bug &amp; strip HTML on plain</message>
  <tree>259d311ce05f595c0ed8dcf711c0820559c769e0</tree>
  <committer>
    <name>Jim Holt</name>
    <email>jim.holt3@gmail.com</email>
  </committer>
</commit>
