aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-22 14:05:45 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-22 14:05:45 +0000
commitb6591e91b037a5c71a68512372ea2da15154fe2f (patch)
treec96674dbcfbe48c6ed6f289d9f580bab9dab811f /mandoc.c
parentbce51df74cd9c0cb090845736c5e6f8313d4fd6c (diff)
downloadmandoc-b6591e91b037a5c71a68512372ea2da15154fe2f.tar.gz
mandoc-b6591e91b037a5c71a68512372ea2da15154fe2f.tar.zst
mandoc-b6591e91b037a5c71a68512372ea2da15154fe2f.zip
Move mandoc_isdelim() back into libmdoc.h. This fixes an unreported
error where (1) -man pages were punctuating delimiters (e.g., `.B a ;') and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its own line) would also be punctuated. This introduces a small amount of complexity of mdoc_{html,term}.c must manage their own spacing with running print_word() or print_text(). The check for delimiting now happens in mdoc_macro.c's dword().
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c52
1 files changed, 1 insertions, 51 deletions
diff --git a/mandoc.c b/mandoc.c
index d493c22f..17e94d37 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.42 2011/03/20 16:02:05 kristaps Exp $ */
+/* $Id: mandoc.c,v 1.43 2011/03/22 14:05:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -506,53 +506,3 @@ mandoc_hyph(const char *start, const char *c)
return(1);
}
-/*
- * Check if a string is a punctuation delimiter. This only applies to
- * mdoc(7) documents, but as it's used in both front-ends and back-ends,
- * it needs to go here (instead of, say, in libmdoc.h).
- */
-enum mdelim
-mandoc_isdelim(const char *p)
-{
-
- if ('\0' == p[0])
- return(DELIM_NONE);
-
- if ('\0' == p[1])
- switch (p[0]) {
- case('('):
- /* FALLTHROUGH */
- case('['):
- return(DELIM_OPEN);
- case('|'):
- return(DELIM_MIDDLE);
- case('.'):
- /* FALLTHROUGH */
- case(','):
- /* FALLTHROUGH */
- case(';'):
- /* FALLTHROUGH */
- case(':'):
- /* FALLTHROUGH */
- case('?'):
- /* FALLTHROUGH */
- case('!'):
- /* FALLTHROUGH */
- case(')'):
- /* FALLTHROUGH */
- case(']'):
- return(DELIM_CLOSE);
- default:
- return(DELIM_NONE);
- }
-
- if ('\\' != p[0])
- return(DELIM_NONE);
-
- if (0 == strcmp(p + 1, "."))
- return(DELIM_CLOSE);
- if (0 == strcmp(p + 1, "*(Ba"))
- return(DELIM_MIDDLE);
-
- return(DELIM_NONE);
-}