Class: ErbMarkdown
- Inherits:
-
ApplicationMarkdown
- Object
- Redcarpet::Render::HTML
- MarkdownRails::Renderer::Base
- MarkdownRails::Renderer::Rails
- ApplicationMarkdown
- ErbMarkdown
- Defined in:
- lib/generators/markdown_rails/install/templates/app/markdown/erb_markdown.rb
Overview
DANGER! This parses Erb, which means arbitrary Ruby can be run. Make sure you trust the source of your markdown and that its not user input.
Instance Attribute Summary
Attributes inherited from MarkdownRails::Renderer::Rails
Instance Method Summary collapse
-
#preprocess(html) ⇒ Object
Enables Erb to render for the entire doc before the markdown is rendered.
Methods inherited from ApplicationMarkdown
Methods inherited from MarkdownRails::Renderer::Rails
default_view_context, #image, #initialize, #renderer
Methods inherited from MarkdownRails::Renderer::Base
Constructor Details
This class inherits a constructor from MarkdownRails::Renderer::Rails
Instance Method Details
#preprocess(html) ⇒ Object
Enables Erb to render for the entire doc before the markdown is rendered. This works great, except when you have an ‘erb` code fence.
7 8 9 10 |
# File 'lib/generators/markdown_rails/install/templates/app/markdown/erb_markdown.rb', line 7 def preprocess(html) # Read more about this render call at https://guides.rubyonrails.org/layouts_and_rendering.html render inline: html, handler: :erb end |