-
- /*
- * 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), 1))
- 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;
- }
-
- /*
- * If there is an open sub-block requiring explicit close-out,
- * postpone closing out the current block
- * until the rew_sub() call closing out the sub-block.
- */
- for (n = m->last; n && n != body && n != blk->parent; n = n->parent) {
- if (MDOC_BLOCK == n->type &&
- MDOC_EXPLICIT & mdoc_macros[n->tok].flags &&
- ! (MDOC_VALID & n->flags)) {
- make_pending(n, tok, m, line, ppos);
- if ( ! mdoc_endbody_alloc(m, line, ppos,
- tok, body, ENDBODY_NOSPACE))
- return(0);
- return(1);
- }
- }
-
- /*
- * If we can't rewind to our body, then our scope has already
- * been closed by another macro (like `Oc' closing `Op'). This
- * is ugly behaviour nodding its head to OpenBSD's overwhelming
- * crufty use of `Op' breakage.
- */
- if (n != body)
- mdoc_vmsg(m, MANDOCERR_SCOPENEST, line, ppos,
- "%s broken", mdoc_macronames[tok]);
-
- if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos))
- return(0);
-
- /* Standard appending of delimiters. */
-
- if (nl && ! append_delims(m, line, pos, buf))
- return(0);
-
- /* Rewind scope, if applicable. */
-
- if (n && ! rew_sub(MDOC_BLOCK, m, tok, line, ppos))
- return(0);
-
- return(1);