diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-12 16:01:01 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-12 16:01:01 +0000 |
commit | 60aba25148a5a3280bb5e9816867afa8659b7a81 (patch) | |
tree | a8b197dcc64f8e48c5011a13913da0293b35838f /mdoc.c | |
parent | 2e08684b6f7079837888e14e0a2129df281b31e8 (diff) | |
download | mandoc-60aba25148a5a3280bb5e9816867afa8659b7a81.tar.gz |
Tiny EOS patch. Back-end cues front-end through flag. Front-end cues output engine with flag.
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -689,7 +689,33 @@ mdoc_ptext(struct mdoc *m, int line, char *buf) /* Allocate the whole word. */ - return(mdoc_word_alloc(m, line, 0, buf)); + if ( ! mdoc_word_alloc(m, line, 0, buf)) + return(0); + + /* + * End-of-sentence check. If the last character is an unescaped + * EOS character, then flag the node as being the end of a + * sentence. The front-end will know how to interpret this. + */ + + assert(i); + + switch (buf[i - 1]) { + case ('.'): + if (i > 1 && '\\' == buf[i - 2]) + break; + /* FALLTHROUGH */ + case ('!'): + /* FALLTHROUGH */ + case ('?'): + m->last->flags |= MDOC_EOS; + break; + default: + break; + + } + + return(1); } |