Class: CustomRender
- Inherits:
-
Redcarpet::Render::Safe
- Object
- Redcarpet::Render::Safe
- CustomRender
- Includes:
- Redcarpet::Render::SmartyPants
- Defined in:
- lib/voom/presenters/web_client/markdown_render.rb
Instance Method Summary collapse
-
#initialize(extensions = {}) ⇒ CustomRender
constructor
A new instance of CustomRender.
- #paragraph(text) ⇒ Object
- #postprocess(full_document) ⇒ Object
Constructor Details
#initialize(extensions = {}) ⇒ CustomRender
Returns a new instance of CustomRender.
4 5 6 |
# File 'lib/voom/presenters/web_client/markdown_render.rb', line 4 def initialize(extensions = {}) super(extensions) end |
Instance Method Details
#paragraph(text) ⇒ Object
8 9 10 |
# File 'lib/voom/presenters/web_client/markdown_render.rb', line 8 def paragraph(text) text + '<br/>' end |
#postprocess(full_document) ⇒ Object
12 13 14 15 |
# File 'lib/voom/presenters/web_client/markdown_render.rb', line 12 def postprocess(full_document) full_document. gsub(/{c:([#\w]\w+)}([^{]+){\/c}/) {|m| "<span style=\"color:#{$1};\">#{$2}</span>"} # color end |