Class: Redmine::WikiFormatting::NullFormatter::Formatter

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, ActionView::Helpers::UrlHelper, LinksHelper
Defined in:
lib/redmine/wiki_formatting.rb

Constant Summary

Constants included from LinksHelper

LinksHelper::AUTO_LINK_RE

Instance Method Summary collapse

Methods included from LinksHelper

#auto_link!, #auto_mailto!, #restore_redmine_links

Constructor Details

#initialize(text) ⇒ Formatter

Returns a new instance of Formatter

Since:

  • 0.8.0



203
204
205
# File 'lib/redmine/wiki_formatting.rb', line 203

def initialize(text)
  @text = text
end

Instance Method Details

#to_html(*args) ⇒ Object

Since:

  • 0.8.0



207
208
209
210
211
212
213
# File 'lib/redmine/wiki_formatting.rb', line 207

def to_html(*args)
  t = CGI::escapeHTML(@text)
  auto_link!(t)
  auto_mailto!(t)
  restore_redmine_links(t)
  simple_format(t, {}, :sanitize => false)
end