- p->sec = mdoc->lastsec;
- p->line = line;
- p->pos = pos;
- p->tok = tok;
- if (MDOC_TEXT != (p->type = type))
- assert(p->tok >= 0);
-
- return(p);
-}
-
-
-int
-mdoc_tail_alloc(struct mdoc *mdoc, int line, int pos, int tok)
-{
- struct mdoc_node *p;
-
- p = node_alloc(mdoc, line, pos, tok, MDOC_TAIL);
- if (NULL == p)
- return(0);
- return(node_append(mdoc, p));
-}
-
-
-int
-mdoc_head_alloc(struct mdoc *mdoc, int line, int pos, int tok)
-{
- struct mdoc_node *p;
-
- assert(mdoc->first);
- assert(mdoc->last);
-
- p = node_alloc(mdoc, line, pos, tok, MDOC_HEAD);
- if (NULL == p)
- return(0);
- return(node_append(mdoc, p));
-}
-
-
-int
-mdoc_body_alloc(struct mdoc *mdoc, int line, int pos, int tok)
-{
- struct mdoc_node *p;
-
- p = node_alloc(mdoc, line, pos, tok, MDOC_BODY);
- if (NULL == p)
- return(0);
- return(node_append(mdoc, p));
-}
-
-
-int
-mdoc_block_alloc(struct mdoc *mdoc, int line, int pos,
- int tok, struct mdoc_arg *args)
-{
- struct mdoc_node *p;
-
- p = node_alloc(mdoc, line, pos, tok, MDOC_BLOCK);
- if (NULL == p)
- return(0);
- if ((p->args = args))
- (args->refcnt)++;
- return(node_append(mdoc, p));
-}
-
-
-int
-mdoc_elem_alloc(struct mdoc *mdoc, int line, int pos,
- int tok, struct mdoc_arg *args)
-{
- struct mdoc_node *p;
-
- p = node_alloc(mdoc, line, pos, tok, MDOC_ELEM);
- if (NULL == p)
- return(0);
- if ((p->args = args))
- (args->refcnt)++;
- return(node_append(mdoc, p));
-}
-
-
-int
-mdoc_word_alloc(struct mdoc *mdoc,
- int line, int pos, const char *word)
-{
- struct mdoc_node *p;
-
- p = node_alloc(mdoc, line, pos, -1, MDOC_TEXT);
- if (NULL == p)
- return(0);
- if (NULL == (p->string = strdup(word))) {
- (void)verr(mdoc, EMALLOC);
- return(0);
+ /*
+ * If a column list contains a non-It macro, assume an implicit
+ * item macro. This can happen one or more times at the
+ * beginning of such a list, intermixed with text lines and
+ * with nodes generated on the roff level, for example by tbl.
+ */
+
+ if ((n->tok == MDOC_Bl && n->type == ROFFT_BODY &&
+ n->end == ENDBODY_NOT && n->norm->Bl.type == LIST_column) ||
+ (n->parent != NULL && n->parent->tok == MDOC_Bl &&
+ n->parent->norm->Bl.type == LIST_column)) {
+ mdoc->flags |= MDOC_FREECOL;
+ mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf);
+ return 1;