Method: Infoboxer::Parser::HTML#html_opening_tag

Defined in:
lib/infoboxer/parser/html.rb

#html_opening_tagObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/infoboxer/parser/html.rb', line 43

def html_opening_tag
  tag = @context.scan(/[a-z]+/)
  attrs = @context.scan(/[^>]+/)
  @context.skip(/>/)
  contents = short_inline(%r{</#{tag}>})
  if @context.matched =~ %r{</#{tag}>}
    HTMLTag.new(tag, parse_params(attrs), contents)
  else
    [
      HTMLOpeningTag.new(tag, parse_params(attrs)),
      *contents
    ]
  end
end