Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

do not send empty text nodes

  • Loading branch information...
commit f0f5e69b2c043be3dd2de66dfdebb71ef07833b4 1 parent 3e4a391
@zetaben authored
Showing with 5 additions and 3 deletions.
  1. +1 −1  Html2Feedbooks.gemspec
  2. +4 −2 lib/feedbooks.rb
View
2  Html2Feedbooks.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = %q{Html2Feedbooks}
- s.version = '0.4.1'
+ s.version = '0.4.2'
s.date = %q{2009-04-28}
s.authors = ["Benoit Larroque"]
s.email = "zeta dot ben at gmail dot com"
View
6 lib/feedbooks.rb
@@ -104,14 +104,16 @@ def to_html
class Text
def to_feedbooks(conf,path=nil)
- doc=Hpricot('<div xmlns:xhtml="http://www.w3.org/1999/xhtml">'+to_html+'</div>')
+ stxt=to_html
+ return unless stxt.strip.size > 0
+ doc=Hpricot('<div xmlns:xhtml="http://www.w3.org/1999/xhtml">'+stxt+'</div>')
doc.traverse_all_element do |e|
unless e.is_a?Hpricot::Text
e.stag.name='xhtml:'+e.stag.name
e.etag.name='xhtml:'+e.etag.name unless e.etag.nil?
end
end
- FBPost.push(conf,'',doc.to_html,"Text",path)
+ FBPost.push(conf,'',doc.to_html,"Text",path)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.