Method: ArticleJSON::Import::GoogleDoc::HTML::HeadingParser#level

Defined in:
lib/article_json/import/google_doc/html/heading_parser.rb

#levelInteger

Determine the level of the heading The level corresponds to the header tag, e.g. ‘<h3>` is level 3.

Returns:

  • (Integer)


20
21
22
23
24
25
26
27
28
# File 'lib/article_json/import/google_doc/html/heading_parser.rb', line 20

def level
  case @node.name
    when 'h1' then 1
    when 'h2' then 2
    when 'h3' then 3
    when 'h4' then 4
    when 'h5' then 5
  end
end