Class: HamlFilter

Inherits:
TextFilter show all
Defined in:
app/models/haml_filter.rb

Instance Method Summary collapse

Methods inherited from TextFilter

descendants_names, filter, find_descendant, inherited

Methods included from Annotatable

included

Methods included from Simpleton

included

Instance Method Details

#filter(text) ⇒ Object



2
3
4
# File 'app/models/haml_filter.rb', line 2

def filter(text)
  Haml::Engine.new(text).render.gsub(/&lt;(\/)?r:(.+?)\s*(\/?\\?)&gt;/m, '<\\1r:\\2\\3>')
end