Class: ActiveadminCms::Processors::ParseMenu

Inherits:
Base
  • Object
show all
Defined in:
app/services/activeadmin_cms/processors/parse_menu.rb

Instance Method Summary collapse

Instance Method Details

#processObject



2
3
4
5
6
7
8
9
# File 'app/services/activeadmin_cms/processors/parse_menu.rb', line 2

def process
  @html.scan(menu_regexp).each do |data|
    html_original = data[0]
    html_processed = wrap(data[2], data[1])
    html_processed.gsub!(/\{\{([a-z]\s)?(?!#{stop_tags})([^\%\/]*?)\}\}/) { "{{menu_item.#{$2}}}" }
    @html.gsub!(html_original, html_processed)
  end
end