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/filter.rb
2015-03-17 23:54:47 +09:00

22 lines
493 B
Ruby

require 'temple/html/filter'
# Hamlit::Filter calls `compile` in the hamlit's original ASTs.
module Hamlit
class Filter < Temple::HTML::Filter
def on_haml_filter(name, exp)
[:haml, :filter, name, compile(exp)]
end
def on_haml_attrs(*exps)
[:haml, :attrs, *exps.map { |e| compile(e) }]
end
def on_haml_script(*exps)
[:haml, :script, *exps.map { |e| compile(e) }]
end
def on_haml_text(exp)
[:haml, :text, compile(exp)]
end
end
end