=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.57 retrieving revision 1.61 diff -u -p -r1.57 -r1.61 --- mandoc/mdoc_man.c 2013/12/25 22:00:45 1.57 +++ mandoc/mdoc_man.c 2014/03/30 23:34:32 1.61 @@ -1,6 +1,6 @@ -/* $Id: mdoc_man.c,v 1.57 2013/12/25 22:00:45 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.61 2014/03/30 23:34:32 schwarze Exp $ */ /* - * Copyright (c) 2011, 2012, 2013 Ingo Schwarze + * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -23,6 +23,7 @@ #include #include "mandoc.h" +#include "mandoc_aux.h" #include "out.h" #include "man.h" #include "mdoc.h" @@ -89,6 +90,7 @@ static int pre_in(DECL_ARGS); static int pre_it(DECL_ARGS); static int pre_lk(DECL_ARGS); static int pre_li(DECL_ARGS); +static int pre_ll(DECL_ARGS); static int pre_nm(DECL_ARGS); static int pre_no(DECL_ARGS); static int pre_ns(DECL_ARGS); @@ -240,6 +242,7 @@ static const struct manact manacts[MDOC_MAX + 1] = { { NULL, pre_sp, post_sp, NULL, NULL }, /* sp */ { NULL, NULL, post_percent, NULL, NULL }, /* %U */ { NULL, NULL, NULL, NULL, NULL }, /* Ta */ + { NULL, pre_ll, post_sp, NULL, NULL }, /* ll */ { NULL, NULL, NULL, NULL, NULL }, /* ROOT */ }; @@ -365,6 +368,9 @@ print_word(const char *s) case (ASCII_HYPH): putchar('-'); break; + case (ASCII_BREAK): + printf("\\:"); + break; case (' '): if (MMAN_nbrword & outflags) { printf("\\ "); @@ -458,7 +464,7 @@ print_offs(const char *v) /* * Set up the indentation for a list item; used from pre_it(). */ -void +static void print_width(const char *v, const struct mdoc_node *child, size_t defsz) { char buf[24]; @@ -510,7 +516,7 @@ print_width(const char *v, const struct mdoc_node *chi TPremain = remain; } -void +static void print_count(int *count) { char buf[12]; @@ -595,7 +601,7 @@ print_node(DECL_ARGS) */ act = manacts + n->tok; cond = NULL == act->cond || (*act->cond)(meta, n); - if (cond && act->pre) + if (cond && act->pre && ENDBODY_NOT == n->end) do_sub = (*act->pre)(meta, n); } @@ -611,8 +617,17 @@ print_node(DECL_ARGS) /* * Lastly, conditionally run the post-node handler. */ + if (MDOC_ENDED & n->flags) + return; + if (cond && act->post) (*act->post)(meta, n); + + if (ENDBODY_NOT != n->end) + n->pending->flags |= MDOC_ENDED; + + if (ENDBODY_NOSPACE == n->end) + outflags &= ~(MMAN_spc | MMAN_nl); } static int @@ -650,7 +665,7 @@ post_enc(DECL_ARGS) suffix = manacts[n->tok].suffix; if (NULL == suffix) return; - outflags &= ~MMAN_spc; + outflags &= ~(MMAN_spc | MMAN_nl); print_word(suffix); } @@ -1399,6 +1414,14 @@ pre_lk(DECL_ARGS) print_word(link->string); font_pop(); return(0); +} + +static int +pre_ll(DECL_ARGS) +{ + + print_line(".ll", 0); + return(1); } static int