=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -p -r1.63 -r1.64 --- mandoc/mdoc_macro.c 2010/05/14 13:31:20 1.63 +++ mandoc/mdoc_macro.c 2010/05/14 14:09:13 1.64 @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.63 2010/05/14 13:31:20 kristaps Exp $ */ +/* $Id: mdoc_macro.c,v 1.64 2010/05/14 14:09:13 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -26,6 +26,7 @@ #include #include "libmdoc.h" +#include "libmandoc.h" enum rew { REWIND_REWIND, @@ -1153,6 +1154,25 @@ blk_part_imp(MACRO_PROT_ARGS) if ( ! mdoc_body_alloc(m, line, ppos, tok)) return(0); body = m->last; + } + + for (n = body->child; n && n->next; n = n->next) + /* Do nothing. */ ; + + /* + * End of sentence spacing: if the last node is a text node and + * has a trailing period, then mark it as being end-of-sentence. + */ + + if (n && MDOC_TEXT == n->type && n->string) + if (mandoc_eos(n->string, strlen(n->string))) + n->flags |= MDOC_EOS; + + /* Up-propogate the end-of-space flag. */ + + if (n && (MDOC_EOS & n->flags)) { + body->flags |= MDOC_EOS; + body->parent->flags |= MDOC_EOS; } /*