Method: HTML5::InBodyPhase#startTagA

Defined in:
lib/html5/html5parser/in_body_phase.rb

#startTagA(name, attributes) ⇒ Object



187
188
189
190
191
192
193
194
195
196
# File 'lib/html5/html5parser/in_body_phase.rb', line 187

def startTagA(name, attributes)
  if afeAElement = @tree.elementInActiveFormattingElements('a')
    parse_error("unexpected-start-tag-implies-end-tag", {"startName" => "a", "endName" => "a"})
    endTagFormatting('a')
    @tree.open_elements.delete(afeAElement) if @tree.open_elements.include?(afeAElement)
    @tree.activeFormattingElements.delete(afeAElement) if @tree.activeFormattingElements.include?(afeAElement)
  end
  @tree.reconstructActiveFormattingElements
  addFormattingElement(name, attributes)
end