aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-01-12 04:54:05 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-01-12 04:54:05 +0000
commita038e809aea161a77e12fae7992376d0f29351e1 (patch)
tree5344ba94c4d59f5fc587160b0324fd7c505509d5
parent503f8abef009e5369607efeb82522c89b976581f (diff)
downloadmandoc-a038e809aea161a77e12fae7992376d0f29351e1.tar.gz
mandoc-a038e809aea161a77e12fae7992376d0f29351e1.tar.zst
mandoc-a038e809aea161a77e12fae7992376d0f29351e1.zip
More accurately represent cells containing horizontal lines in -T tree
output. In particular, do not represent "_" as "-", and distinguish "_" from "\_" and "=" from "\=". Output tweak following a related question from Ted Bullock <tbullock at comlore dot com>.
-rw-r--r--tree.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tree.c b/tree.c
index 12e841a5..7c1c662d 100644
--- a/tree.c
+++ b/tree.c
@@ -1,7 +1,7 @@
-/* $Id: tree.c,v 1.91 2021/09/07 10:59:18 schwarze Exp $ */
+/* $Id: tree.c,v 1.92 2022/01/12 04:54:05 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013-2015, 2017-2022 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -509,12 +509,16 @@ print_span(const struct tbl_span *sp, int indent)
putchar('x');
}
switch (dp->pos) {
- case TBL_DATA_HORIZ:
case TBL_DATA_NHORIZ:
- putchar('-');
+ putchar('\\');
+ /* FALLTHROUGH */
+ case TBL_DATA_HORIZ:
+ putchar('_');
break;
- case TBL_DATA_DHORIZ:
case TBL_DATA_NDHORIZ:
+ putchar('\\');
+ /* FALLTHROUGH */
+ case TBL_DATA_DHORIZ:
putchar('=');
break;
default: