mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
22 lines
493 B
Ruby
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
|