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

32 lines
564 B
Ruby
Raw Normal View History

require 'temple/html/fast'
module Hamlit
class HTML < Temple::HTML::Fast
2015-03-25 01:51:40 +09:00
define_options :format
2015-03-23 01:25:29 +09:00
def initialize(opts = {})
super rewrite_format(opts)
end
private
# Temple's warning is noisy.
def rewrite_format(options)
2015-03-23 01:35:06 +09:00
options = options.dup
options[:format] = normalize_format(options[:format]) if options[:format]
options
end
2015-03-25 01:51:40 +09:00
def normalize_format(format)
return :html unless format
case format
when :html4, :html5
:html
else
format
end
end
end
end