require 'rexml/parsers/baseparser' module Kramdown module Converter # Converts a Kramdown::Document to HTML. # # You can customize the HTML converter by sub-classing it and overriding the +convert_NAME+ # methods. Each such method takes the following parameters: # # [+el+] The element of type +NAME+ to be converted. # # [+indent+] A number representing the current amount of spaces for indent (only used for # block-level elements). # # The return value of such a method has to be a string containing the element +el+ formatted as # HTML element. class Html < Base def convert_info_box(el, indent) if el.attr['class'] el.attr['class'] = el.attr['class'].include?('test') ? el.attr['class'] : el.attr['class'].split.unshift('test').reject(&:empty?).join(' ') else el.attr['class'] = 'infoBox' end "#{' '*indent}