Module: Escapement::PrettyNames

Included in:
Element::Base, Tag
Defined in:
lib/escapement/pretty_names.rb

Instance Method Summary collapse

Instance Method Details

#node_to_typeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/escapement/pretty_names.rb', line 3

def node_to_type
  case node.name
  when 'p' then 'paragraph'
  when 'ul' then 'unordered_list'
  when 'ol' then 'ordered_list'
  when 'a' then 'link'
  when 'i', 'em' then 'italic'
  when 'u' then 'underline'
  when 'strong', 'b' then 'bold'
  when 'abbr' then 'abbreviation'
  when 'q' then 'quote'
  when 'pre' then 'preformatted'
  when 'img' then 'image'
  when 'li' then 'list_item'
  when 'sup' then 'superscript'
  when 'sub' then 'subscript'
  when /h\d/ then 'header'
  else node.name
  end
end