diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-05-04 17:48:28 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-05-04 17:48:28 +0000 |
commit | 5fbabdf032b370e99e8685958b6e15eb3b2ff0f7 (patch) | |
tree | 56bbeb9f07b66610d5173e36db18df3fba402155 /mdoc_html.c | |
parent | 90c0bcfc5ca59192e72f849591c6ec10e8048bf0 (diff) | |
download | mandoc-5fbabdf032b370e99e8685958b6e15eb3b2ff0f7.tar.gz |
Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 1a8f7d76..f4fc9699 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -237,7 +237,6 @@ static const struct htmlmdoc __mdocs[MDOC_MAX - MDOC_Dd] = { {mdoc_quote_pre, mdoc_quote_post}, /* En */ {mdoc_xx_pre, NULL}, /* Dx */ {mdoc__x_pre, mdoc__x_post}, /* %Q */ - {mdoc_sp_pre, NULL}, /* br */ {mdoc_sp_pre, NULL}, /* sp */ {mdoc__x_pre, mdoc__x_post}, /* %U */ {NULL, NULL}, /* Ta */ @@ -394,6 +393,16 @@ print_mdoc_node(MDOC_ARGS) t = h->tag; } assert(h->tblt == NULL); + if (n->tok < ROFF_MAX) { + switch(n->tok) { + case ROFF_br: + mdoc_sp_pre(meta, n, h); + break; + default: + abort(); + } + break; + } assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); if (mdocs[n->tok].pre != NULL && (n->end == ENDBODY_NOT || n->child != NULL)) @@ -415,7 +424,9 @@ print_mdoc_node(MDOC_ARGS) case ROFFT_EQN: break; default: - if (mdocs[n->tok].post == NULL || n->flags & NODE_ENDED) + if (n->tok < ROFF_MAX || + mdocs[n->tok].post == NULL || + n->flags & NODE_ENDED) break; (*mdocs[n->tok].post)(meta, n, h); if (n->end != ENDBODY_NOT) @@ -1005,7 +1016,7 @@ mdoc_bd_pre(MDOC_ARGS) */ switch (nn->tok) { case MDOC_Sm: - case MDOC_br: + case ROFF_br: case MDOC_sp: case MDOC_Bl: case MDOC_D1: |