1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/hamlit/html.rb
2015-03-25 01:51:42 +09:00

31 lines
564 B
Ruby

require 'temple/html/fast'
module Hamlit
class HTML < Temple::HTML::Fast
define_options :format
def initialize(opts = {})
super rewrite_format(opts)
end
private
# Temple's warning is noisy.
def rewrite_format(options)
options = options.dup
options[:format] = normalize_format(options[:format]) if options[:format]
options
end
def normalize_format(format)
return :html unless format
case format
when :html4, :html5
:html
else
format
end
end
end
end