Class: Kramdown::Converter::CustomHtml

Inherits:
Html
  • Object
show all
Defined in:
lib/markdown.rb

Instance Method Summary collapse

Instance Method Details

#add_class(attr, class_name) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/markdown.rb', line 37

def add_class(attr, class_name)
    if attr.has_key?("class")
        attr[:class] = attr[:class] + " " + class_name
    else
        attr[:class] = class_name
    end
    attr
end

#convert_em(el, indent) ⇒ Object



7
8
9
# File 'lib/markdown.rb', line 7

def convert_em(el, indent)
    "<span#{html_attributes(add_class(el.attr, "uk-text-italic"))}>#{inner(el, indent)}</span>"
end

#convert_strong(el, indent) ⇒ Object



11
12
13
# File 'lib/markdown.rb', line 11

def convert_strong(el, indent)
    "<span#{html_attributes(add_class(el.attr, "uk-text-bold"))}>#{inner(el, indent)}</span>"
end

#convert_table(el, indent) ⇒ Object



16
17
18
# File 'lib/markdown.rb', line 16

def convert_table(el, indent)
    format_as_indented_block_html(el.type, add_class(el.attr, "uk-table uk-table-divider"), inner(el, indent), indent)
end

#convert_tbody(el, indent) ⇒ Object



24
25
26
# File 'lib/markdown.rb', line 24

def convert_tbody(el, indent)
    format_as_indented_block_html(el.type, el.attr, inner(el, indent), indent)
end

#convert_tfoot(el, indent) ⇒ Object



28
29
30
# File 'lib/markdown.rb', line 28

def convert_tfoot(el, indent)
    format_as_indented_block_html(el.type, el.attr, inner(el, indent), indent)
end

#convert_thead(el, indent) ⇒ Object



20
21
22
# File 'lib/markdown.rb', line 20

def convert_thead(el, indent)
    format_as_indented_block_html(el.type, el.attr, inner(el, indent), indent)
end

#convert_tr(el, indent) ⇒ Object



32
33
34
# File 'lib/markdown.rb', line 32

def convert_tr(el, indent)
    format_as_indented_block_html(el.type, el.attr, inner(el, indent), indent)
end