Class: Gollum::Filter::PlainText

Inherits:
Gollum::Filter show all
Defined in:
lib/gollum-lib/filter/plain_text.rb

Overview

Plain Text

Render plain text documents in a <pre> block without any special markup.

Constant Summary

Constants inherited from Gollum::Filter

PLACEHOLDER_PATTERN

Instance Attribute Summary

Attributes inherited from Gollum::Filter

#close_pattern, #open_pattern

Instance Method Summary collapse

Methods inherited from Gollum::Filter

#initialize

Methods included from Helpers

#path_to_link_text, #trim_leading_slashes

Constructor Details

This class inherits a constructor from Gollum::Filter

Instance Method Details

#do_process(_d) ⇒ Object



9
10
11
# File 'lib/gollum-lib/filter/plain_text.rb', line 9

def do_process(_d)
  skip? ? _d : process(_d)
end

#extract(data) ⇒ Object



13
14
15
# File 'lib/gollum-lib/filter/plain_text.rb', line 13

def extract(data)
  @markup.format == :txt ? "<pre>#{CGI.escapeHTML(data)}</pre>" : data
end

#process(data) ⇒ Object



17
18
19
# File 'lib/gollum-lib/filter/plain_text.rb', line 17

def process(data)
  data
end