module Quby::TextTransformation

Constants

Modal pop up window link: ~~url~~link_body~~

TEXT_VAR_REGEX

Textvars: Replace {{var_name}} with <span class='textvar' textvar='var_name'></span>

Public Instance Methods

textvar_html(var_name) click to toggle source
# File lib/quby/text_transformation.rb, line 22
def textvar_html(var_name)
  "<span class='textvar' textvar='#{var_name}'>{{#{var_name}}}</span>"
end
transform_special_text(text) click to toggle source

to eventually replace maruku_extensions.rb this helper transforms ~~ links and {{text vars}} into html

# File lib/quby/text_transformation.rb, line 13
def transform_special_text(text)
  text.gsub(LINK_URL_REGEX) { link_html($~[:url], $~[:link_content]) }
      .gsub(TEXT_VAR_REGEX) { textvar_html($~[:text_var]) }
end