class Asciidoctor::Document

def finalize_header unrooted_attributes, header_valid = true

QUESTION is finalize_header the right name?
QUESTION should we invoke the TreeProcessors here, passing in a phase?
--
the body, even if no header is found.
Internal: Called by the parser after parsing the header and before parsing
def finalize_header unrooted_attributes, header_valid = true
  clear_playback_attributes unrooted_attributes
  save_attributes
  unrooted_attributes['invalid-header'] = true unless header_valid
  unrooted_attributes
end