diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-17 12:40:48 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-17 12:40:48 +0000 |
commit | a78f7ea60ac3b0e2c941afc20e674fe437317174 (patch) | |
tree | 6c2d30c31b6daa8f4c894581f1d5d02c99c91f51 /mdoc_term.c | |
parent | 9557817be488da39b7f0e34162706877c0652fc3 (diff) | |
download | mandoc-a78f7ea60ac3b0e2c941afc20e674fe437317174.tar.gz mandoc-a78f7ea60ac3b0e2c941afc20e674fe437317174.tar.zst mandoc-a78f7ea60ac3b0e2c941afc20e674fe437317174.zip |
`sp' documented: validates & produces correct output.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 41338aa5..f290a91d 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.44 2009/07/17 10:56:57 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.45 2009/07/17 12:40:48 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -164,6 +164,7 @@ static int termp_rs_pre(DECL_ARGS); static int termp_rv_pre(DECL_ARGS); static int termp_sh_pre(DECL_ARGS); static int termp_sm_pre(DECL_ARGS); +static int termp_sp_pre(DECL_ARGS); static int termp_sq_pre(DECL_ARGS); static int termp_ss_pre(DECL_ARGS); static int termp_sx_pre(DECL_ARGS); @@ -294,7 +295,7 @@ static const struct termact termacts[MDOC_MAX] = { { termp_xx_pre, NULL }, /* Dx */ { NULL, NULL }, /* %Q */ { termp_br_pre, NULL }, /* br */ - { NULL, NULL }, /* sp */ + { termp_sp_pre, NULL }, /* sp */ }; #ifdef __linux__ @@ -1833,6 +1834,27 @@ termp_in_post(DECL_ARGS) /* ARGSUSED */ static int +termp_sp_pre(DECL_ARGS) +{ + int i, len; + + if (NULL == node->child) { + term_vspace(p); + return(0); + } + + len = atoi(node->child->string); + if (0 == len) + term_newln(p); + for (i = 0; i < len; i++) + term_vspace(p); + + return(0); +} + + +/* ARGSUSED */ +static int termp_br_pre(DECL_ARGS) { |