Class: Jazzy::JazzyHTML
- Inherits:
-
Redcarpet::Render::HTML
- Object
- Redcarpet::Render::HTML
- Jazzy::JazzyHTML
- Includes:
- Redcarpet::Render::SmartyPants, Rouge::Plugins::Redcarpet
- Defined in:
- lib/jazzy/jazzy_markdown.rb
Constant Summary collapse
- OPTIONS =
{ autolink: true, fenced_code_blocks: true, no_intra_emphasis: true, quote: true, strikethrough: true, space_after_headers: false, tables: true, }.freeze
Instance Method Summary collapse
Instance Method Details
#header(text, header_level) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jazzy/jazzy_markdown.rb', line 10 def header(text, header_level) text_slug = text.gsub(/[^a-zA-Z0-9]+/, '_') .downcase .sub(/^_/, '') .sub(/_$/, '') "<a href='##{text_slug}' class='anchor' aria-hidden=true>" \ '<span class="header-anchor"></span>' \ '</a>' \ "<h#{header_level} id='#{text_slug}'>#{text}</h#{header_level}>\n" end |