out << indent << " " << m_data << '\n';
}
out << indent << std::format("</{}>\n", m_name);
out << indent << std::format("</{}>\n", m_tag);
return;
}
if (m_children.empty()) {
if (tgl_state()) {
out << indent << std::format("<{} {}>\n", m_name, m_attributes);
out << indent << std::format("<{} {}>\n", m_tag, attributes());
} else {
out << indent << std::format("</{}>\n", m_name);
out << indent << std::format("</{}>\n", m_tag);
}
} else {
out << indent << std::format("<{} {}>\n", m_name, m_attributes);
out << indent << std::format("<{} {}>\n", m_tag, attributes());
render_children(out, indent_value + 2);
out << indent << std::format("</{}>\n", m_name);
out << indent << std::format("</{}>\n", m_tag);
}
}
element& element::set(const attribute_list& list)
{
m_attributes.set(list);
return *this;
}
element& element::set(attribute attr)
{
m_attributes.set(std::move(attr));
return *this;
}
element element::add(const attribute_list& list) const
{
return element(*this).set(list);
}
element element::add(attribute attr) const
{
return element(*this).set(std::move(attr));
}
} // namespace hemplate