Class: Lookbook::MarkdownRenderer::LookbookMarkdownRenderer
- Inherits:
-
Redcarpet::Render::HTML
- Object
- Redcarpet::Render::HTML
- Lookbook::MarkdownRenderer::LookbookMarkdownRenderer
- Defined in:
- lib/lookbook/services/markdown_renderer.rb
Instance Method Summary collapse
Instance Method Details
#block_code(code, language = "ruby") ⇒ Object
19 20 21 22 23 24 |
# File 'lib/lookbook/services/markdown_renderer.rb', line 19 def block_code(code, language = "ruby") line_numbers = language.to_s.end_with? "-numbered" ApplicationController.render(Lookbook::Code::Component.new(source: code, language: language.to_s.chomp("-numbered"), line_numbers: line_numbers), layout: nil) end |
#postprocess(full_document) ⇒ Object
26 27 28 29 30 |
# File 'lib/lookbook/services/markdown_renderer.rb', line 26 def postprocess(full_document) full_document&.gsub!("<p><lookbook", "<lookbook") full_document&.gsub!("</lookbook-embed></p>", "</lookbook-embed>") full_document end |