Class Kramdown::Converter::Html
In: lib/kramdown/converter/html.rb
Parent: Base

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.

Methods

Included Modules

::Kramdown::Utils::Html

Constants

HIGHLIGHTING_AVAILABLE = true   Highlighting via coderay is available if this constant is true.
DISPATCHER = Hash.new {|h,k| h[k] = "convert_#{k}"}   The mapping of element type to conversion method.
TYPOGRAPHIC_SYMS = { :mdash => [::Kramdown::Utils::Entities.entity('mdash')], :ndash => [::Kramdown::Utils::Entities.entity('ndash')], :hellip => [::Kramdown::Utils::Entities.entity('hellip')], :laquo_space => [::Kramdown::Utils::Entities.entity('laquo'), ::Kramdown::Utils::Entities.entity('nbsp')], :raquo_space => [::Kramdown::Utils::Entities.entity('nbsp'), ::Kramdown::Utils::Entities.entity('raquo')], :laquo => [::Kramdown::Utils::Entities.entity('laquo')], :raquo => [::Kramdown::Utils::Entities.entity('raquo')]

Attributes

indent  [RW]  The amount of indentation used when nesting HTML tags.

Public Class methods

Initialize the HTML converter with the given Kramdown document doc.

Public Instance methods

Dispatch the conversion of the element el to a convert_TYPE method using the type of the element.

convert_dd(el, indent)

Alias for convert_li

convert_dl(el, indent)

Alias for convert_ul

convert_ol(el, indent)

Alias for convert_ul

convert_strong(el, indent)

Alias for convert_em

convert_tbody(el, indent)

Alias for convert_thead

convert_tfoot(el, indent)

Alias for convert_thead

convert_tr(el, indent)

Alias for convert_thead

convert_xml_pi(el, indent)

Return a HTML ordered list with the footnote content for the used footnotes.

Generate and return an element tree for the table of contents.

Return the converted content of the children of el as a string. The parameter indent has to be the amount of indentation used for the element el.

Pushes el onto the @stack before converting the child elements and pops it from the stack afterwards.

Obfuscate the text by using HTML entities.

[Validate]