lib/reverse_markdown/converters/base.rb in reverse_markdown-2.1.1 vs lib/reverse_markdown/converters/base.rb in reverse_markdown-3.0.0
- old
+ new
@@ -1,10 +1,10 @@
module ReverseMarkdown
module Converters
class Base
def treat_children(node, state)
- node.children.inject('') do |memo, child|
+ node.children.inject(+'') do |memo, child|
memo << treat(child, state)
end
end
def treat(node, state)
@@ -16,9 +16,13 @@
end
def extract_title(node)
title = escape_keychars(node['title'].to_s)
title.empty? ? '' : %[ "#{title}"]
+ end
+
+ def extract_src(node)
+ node['src'].to_s.empty? ? '' : node['src'].to_s
end
end
end
end