Class: ClWiki::CustomFormatters

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/cl_wiki/page.rb

Instance Method Summary collapse

Instance Method Details

#process_formatters(content, page) ⇒ Object



468
469
470
471
472
473
474
# File 'lib/cl_wiki/page.rb', line 468

def process_formatters(content, page)
  @formatters.each do |f|
    if content =~ f.match_re
      content.gsub!(f.match_re) { |match| f.format_content(match, page) }
    end
  end if @formatters
end

#register(class_ref) ⇒ Object



463
464
465
466
# File 'lib/cl_wiki/page.rb', line 463

def register(class_ref)
  @formatters ||= []
  @formatters << class_ref
end