module Docs class Parser def initialize(content) @content = content end def html @html ||= quietly { document? ? parse_as_document : parse_as_fragment } end private def document? @content =~ /\A\s*