diff --git a/lib/haml/engine.rb b/lib/haml/engine.rb index 720e3ab4..9798c126 100644 --- a/lib/haml/engine.rb +++ b/lib/haml/engine.rb @@ -783,7 +783,8 @@ END # This means that we can render the tag directly to text and not process it in the buffer open_tag = prerender_tag(tag_name, atomic, attributes) - if tag_closed = do_one_liner && !parse + tag_closed = do_one_liner && !parse + if tag_closed open_tag += value open_tag += "" end diff --git a/lib/haml/html.rb b/lib/haml/html.rb index da388d12..24713efe 100644 --- a/lib/haml/html.rb +++ b/lib/haml/html.rb @@ -129,7 +129,8 @@ module Haml def to_haml(tabs = 0) output = "#{tabulate(tabs)}" if HTML.options[:rhtml] && name[0...5] == 'haml:' - return output + HTML.send("haml_tag_#{name[5..-1]}", self.innerHTML) + return output + HTML.send("haml_tag_#{name[5..-1]}", + CGI.unescapeHTML(self.innerHTML)) end output += "%#{name}" unless name == 'div' && (attributes.include?('id') || attributes.include?('class'))