class Caramelize::CamelCaseToWikiLinks

Public Class Methods

new(body) click to toggle source
# File lib/caramelize/filters/camel_case_to_wiki_links.rb, line 5
def initialize(body)
  @body = body
end

Public Instance Methods

run() click to toggle source

take an input stream and convert all wikka syntax to markdown syntax

# File lib/caramelize/filters/camel_case_to_wiki_links.rb, line 10
def run
  migrated_body = @body.dup

  migrated_body.gsub!(/([^\[\|\w\S])([A-Z]\w+[A-Z]\w+)([^\]])/) { "#{::Regexp.last_match(1)}#{format_link(::Regexp.last_match(2))}#{::Regexp.last_match(3)}" }

  migrated_body
end

Private Instance Methods