Class: PagesCore::HtmlFormatter
- Inherits:
-
Object
- Object
- PagesCore::HtmlFormatter
- Defined in:
- app/formatters/pages_core/html_formatter.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(string, options = {}) ⇒ HtmlFormatter
constructor
A new instance of HtmlFormatter.
- #to_html ⇒ Object
Constructor Details
#initialize(string, options = {}) ⇒ HtmlFormatter
Returns a new instance of HtmlFormatter.
11 12 13 14 |
# File 'app/formatters/pages_core/html_formatter.rb', line 11 def initialize(string, = {}) @string = string @options = end |
Class Method Details
.to_html(string, options = {}) ⇒ Object
6 7 8 |
# File 'app/formatters/pages_core/html_formatter.rb', line 6 def to_html(string, = {}) new(string, ).to_html end |
Instance Method Details
#to_html ⇒ Object
16 17 18 19 20 |
# File 'app/formatters/pages_core/html_formatter.rb', line 16 def to_html string = shorten(parse_images(parse_files((@string)))) string += " #{@options[:append]}" if @options[:append] fix_markup(RedCloth.new(string).to_html).html_safe end |