def section node
doctype = node.document.doctype
if node.special
if (tag_name = node.sectname).start_with? 'sect'
tag_name = 'section'
end
else
tag_name = doctype == 'book' && node.level <= 1 ? (node.level == 0 ? 'part' : 'chapter') : 'section'
end
if doctype == 'manpage'
if tag_name == 'section'
tag_name = 'refsection'
elsif tag_name == 'synopsis'
tag_name = 'refsynopsisdiv'
end
end
%(<#{tag_name}#{common_attributes node.id, node.role, node.reftext}>
<title>#{node.title}</title>
#{node.content}
</#{tag_name}>)
end