in src/commonMain/kotlin/org/intellij/markdown/flavours/gfm/GFMGeneratingProviders.kt [155:179]
override fun processNode(visitor: HtmlGenerator.HtmlGeneratingVisitor, text: String, node: ASTNode) {
assert(node.type == GFMElementTypes.TABLE)
val alignmentInfo = getAlignmentInfo(text, node)
var rowsPopulated = 0
visitor.consumeTagOpen(node, "table")
for (child in node.children) {
if (child.type == GFMElementTypes.HEADER) {
visitor.consumeHtml("<thead>")
populateRow(visitor, child, "th", alignmentInfo, -1)
visitor.consumeHtml("</thead>")
} else if (child.type == GFMElementTypes.ROW) {
if (rowsPopulated == 0) {
visitor.consumeHtml("<tbody>")
}
rowsPopulated++
populateRow(visitor, child, "td", alignmentInfo, rowsPopulated)
}
}
if (rowsPopulated > 0) {
visitor.consumeHtml("</tbody>")
}
visitor.consumeTagClose("table")
}