def open_block(node, id, style, role, reftext, title)
case style
when 'abstract'
if node.parent == node.document && node.document.attr?('doctype', 'book')
warn 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'
''
else
%Q(<abstract>#{title && "\n<title>#{title}</title>"}
#{content node}
</abstract>)
end
when 'partintro'
unless node.document.attr?('doctype', 'book') && node.parent.is_a?(Asciidoctor::Section) && node.level == 0
warn 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\s a child of a part section. Excluding block content.'
''
else
%Q(<partintro#{common_attrs id, role, reftext}>#{title && "\n<title>#{title}</title>"}
#{content node}
</partintro>)
end
else
node.content
end
end