heading = par->getField("heading")[0];
// start the heading tag
out << "\t\t";
// the second field marks the heading. So let's write it.
writeParagraph(heading, 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 : par->getField()) {
if (text->getDescriptor()->getName() != "text") {
throw OusiaException("Expected text!");
}
Handle primitive =
text->getField()[0].cast();
if (primitive.isNull()) {
throw OusiaException("Text field is not primitive!");
}
out << primitive->getContent().asString();
}
// write end tag
if (writePTags) {
out << "
\n";
}
}
}
}