Class: NanDoc::Filters::CustomTagsClass

Inherits:
Array
  • Object
show all
Defined in:
lib/nandoc/filters/custom-tags.rb

Instance Method Summary collapse

Instance Method Details

#change_item_content(content) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/nandoc/filters/custom-tags.rb', line 6

def change_item_content content
  each do |cls|
    if cls =~ content
      tag_filter = cls.new
      new_content = tag_filter.run(content)
      content.replace(new_content)
    end
  end
  content
end

#register_class(cls) ⇒ Object



3
4
5
# File 'lib/nandoc/filters/custom-tags.rb', line 3

def register_class cls
  unshift cls
end