diff options
author | 2017-05-04 22:07:44 +0000 | |
---|---|---|
committer | 2017-05-04 22:07:44 +0000 | |
commit | 96a5de472ceddce830e148f3c839441f7b9343b2 (patch) | |
tree | fcc212399dcdae50546a59c41f02be08c9f1a3c5 /usr.bin/mandoc/mdoc_html.c | |
parent | enable brgphy, which appears in the edgerouter pro (diff) | |
download | wireguard-openbsd-96a5de472ceddce830e148f3c839441f7b9343b2.tar.xz wireguard-openbsd-96a5de472ceddce830e148f3c839441f7b9343b2.zip |
Start roff formatter modules for HTML and termininal output,
used by both the mdoc and man formatters, with the ultimate
goal of reducing code duplication between the two macro formatters.
Made possible by the parser unification.
Add the first formatting function (for the .br request).
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 72afef4cf03..de61d94cfcb 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.156 2017/05/04 17:48:24 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.157 2017/05/04 22:07:44 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -392,13 +392,7 @@ print_mdoc_node(MDOC_ARGS) } assert(h->tblt == NULL); if (n->tok < ROFF_MAX) { - switch(n->tok) { - case ROFF_br: - mdoc_sp_pre(meta, n, h); - break; - default: - abort(); - } + roff_html_pre(h, n); break; } assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); @@ -1335,16 +1329,12 @@ mdoc_sp_pre(MDOC_ARGS) struct roffsu su; SCALE_VS_INIT(&su, 1); - - if (MDOC_sp == n->tok) { - if (NULL != (n = n->child)) { - if ( ! a2roffsu(n->string, &su, SCALE_VS)) - su.scale = 1.0; - else if (su.scale < 0.0) - su.scale = 0.0; - } - } else - su.scale = 0.0; + if (NULL != (n = n->child)) { + if ( ! a2roffsu(n->string, &su, SCALE_VS)) + su.scale = 1.0; + else if (su.scale < 0.0) + su.scale = 0.0; + } print_otag(h, TAG_DIV, "suh", &su); |