Class: DocumentGenerator::Output
- Inherits:
-
Object
- Object
- DocumentGenerator::Output
- Defined in:
- lib/document_generator/output.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#description ⇒ Object
Returns the value of attribute description.
Class Method Summary collapse
-
.no_really_escape(value) ⇒ Object
TODO: This is due to a bug in maruku.
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/document_generator/output.rb', line 3 def content @content end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/document_generator/output.rb', line 3 def description @description end |
Class Method Details
.no_really_escape(value) ⇒ Object
TODO: This is due to a bug in maruku. We should create an issue there–and possibly a PR to fix?
7 8 9 10 11 12 13 14 15 |
# File 'lib/document_generator/output.rb', line 7 def self.no_really_escape(value) value.split("\n").map do |line| if line.strip.size.zero? " " else line end end.join("\n") end |
Instance Method Details
#escaped_content ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/document_generator/output.rb', line 17 def escaped_content temp = [] content.each do |line| temp << line temp << "\n" end Output.no_really_escape(CGI.escapeHTML(temp.join.rstrip)) end |