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