> &fields = par->getFields();
// write heading if its there.
// check if we have a heading.
if (fields.size() > 1 && fields[1].size() > 0) {
// start the heading tag
out << "\t\t";
// the second field marks the heading. So let's write it.
writeParagraph(fields[1][0], out, false);
// close the heading tag.
out << "
\n";
}
// write start tag
if (writePTags) {
out << "\t\t";
}
// write content
// TODO: What about emphasis?
for (auto &text : fields[0]) {
if (text->getDescriptor()->getName() != "text") {
throw OusiaException("Expected text!");
}
Handle primitive =
text->getFields()[0][0].cast();
if (primitive == nullptr) {
throw OusiaException("Text field is not primitive!");
}
out << primitive->getContent().asString();
}
// write end tag
if (writePTags) {
out << "
\n";
}
}
}
}