From 97b676fcc5cd317a205a14014dc4c69cf25e69b7 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Mon, 11 Feb 2019 15:56:26 +0100 Subject: [PATCH] Use Middleman content_tag into our custom markdown renderer --- guides/lib/custom_markdown_renderer.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guides/lib/custom_markdown_renderer.rb b/guides/lib/custom_markdown_renderer.rb index ec8877e5037..3e1eecb6a88 100644 --- a/guides/lib/custom_markdown_renderer.rb +++ b/guides/lib/custom_markdown_renderer.rb @@ -2,6 +2,8 @@ class CustomMarkdownRenderer < Redcarpet::Render::HTML include ImageHelpers + include ::Padrino::Helpers::OutputHelpers + include ::Padrino::Helpers::TagHelpers def block_code(code, language) path = code.lines.first[/^#\s(\S*)$/, 1] @@ -19,7 +21,9 @@ def table(header, body) end def header(text, header_level) - "%s" % [header_level, text.parameterize, text, header_level] + content_tag "h#{header_level}", id: text.parameterize, class: 'offset' do + text + end end def link(link, title, content)