Class: Webgen::ContentProcessor::Kramdown::CustomHtmlConverter
- Inherits:
-
Kramdown::Converter::Html
- Object
- Kramdown::Converter::Html
- Webgen::ContentProcessor::Kramdown::CustomHtmlConverter
- Defined in:
- lib/webgen/content_processor/kramdown.rb
Overview
:nodoc:
Instance Method Summary collapse
- #convert_a(el, indent) ⇒ Object
- #convert_img(el, indent) ⇒ Object
-
#initialize(root, options, context) ⇒ CustomHtmlConverter
constructor
A new instance of CustomHtmlConverter.
Constructor Details
#initialize(root, options, context) ⇒ CustomHtmlConverter
Returns a new instance of CustomHtmlConverter.
15 16 17 18 19 20 |
# File 'lib/webgen/content_processor/kramdown.rb', line 15 def initialize(root, , context) super(root, ) @context = context @do_convert = context.website.config['content_processor.kramdown.handle_links'] @ignore_fragments = context.website.config['content_processor.kramdown.ignore_unknown_fragments'] end |
Instance Method Details
#convert_a(el, indent) ⇒ Object
22 23 24 25 26 |
# File 'lib/webgen/content_processor/kramdown.rb', line 22 def convert_a(el, indent) el.attr['href'] = @context.tag('relocatable', {'path' => el.attr['href'], 'ignore_unknown_fragment' => @ignore_fragments}) if @do_convert super end |
#convert_img(el, indent) ⇒ Object
28 29 30 31 32 |
# File 'lib/webgen/content_processor/kramdown.rb', line 28 def convert_img(el, indent) el.attr['src'] = @context.tag('relocatable', {'path' => el.attr['src'], 'ignore_unknown_fragment' => @ignore_fragments}) if @do_convert super end |