Class: Bhook::Converter::Html
- Inherits:
-
Kramdown::Converter::Html
- Object
- Kramdown::Converter::Html
- Bhook::Converter::Html
- Extended by:
- T::Sig
- Defined in:
- lib/bhook/converter/html.rb
Instance Method Summary collapse
- #convert_a(el, indent) ⇒ Object
- #convert_header(el, indent) ⇒ Object
-
#initialize(root, options) ⇒ Html
constructor
A new instance of Html.
Constructor Details
Instance Method Details
#convert_a(el, indent) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/bhook/converter/html.rb', line 16 def convert_a(el, indent) href_path = el.attr['href'] if valid_relative_md_link?(href_path) L.debug "Found link: #{href_path}" el.attr['href'].gsub!(/\.md/, '.html') end super(el, indent) end |
#convert_header(el, indent) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/bhook/converter/html.rb', line 26 def convert_header(el, indent) src_title = el.[:raw_text] after_h1_html = @options[:after_h1_strategy].call(binding) level = output_header_level(el.[:level]) if level == 1 @options[:h1_callback].call(src_title) "#{super(el, indent)}#{' ' * indent}#{after_h1_html}" else insert_anchor_into_header!(el) super(el, indent) end end |