static const char *xml_attr(cmark_syntax_extension *extension,
                            cmark_node *node) {
  if (node->type == CMARK_NODE_TABLE_CELL) {
    if (cmark_gfm_extensions_get_table_row_is_header(node->parent)) {
      uint8_t *alignments = get_table_alignments(node->parent->parent);
      int i = 0;
      cmark_node *n;
      for (n = node->parent->first_child; n; n = n->next, ++i)
        if (n == node)
          break;
      switch (alignments[i]) {
      case 'l': return " align=\"left\"";
      case 'c': return " align=\"center\"";
      case 'r': return " align=\"right\"";
      }
    }
  }

  return NULL;
}
static const char *xml_attr(cmark_syntax_extension *extension,
                            cmark_node *node) {
  if (node->type == CMARK_NODE_TABLE_CELL) {
    if (cmark_gfm_extensions_get_table_row_is_header(node->parent)) {
      uint8_t *alignments = get_table_alignments(node->parent->parent);
      int i = 0;
      cmark_node *n;
      for (n = node->parent->first_child; n; n = n->next, ++i)
        if (n == node)
          break;
      switch (alignments[i]) {
      case 'l': return " align=\"left\"";
      case 'c': return " align=\"center\"";
      case 'r': return " align=\"right\"";
      }
    }
  }

  return NULL;
}