summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-14 19:34:55 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-14 19:34:55 +0000
commit7bef6a6299b4d515e77b64909e5a342877bbde31 (patch)
treef6a816a25b708d2addfabe7397357421083ecc1b /usr.bin/mandoc
parentaf5f7302f8424a57cef0342939276caa0bf9b6c9 (diff)
Show long .Lk URIs in like an indented display, similar to groff.
Suggested by bentley@.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/mdoc_term.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 8605cf23208..13f450dd40e 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_term.c,v 1.246 2017/04/14 18:23:29 schwarze Exp $ */
+/* $OpenBSD: mdoc_term.c,v 1.247 2017/04/14 19:34:54 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1991,6 +1991,7 @@ static int
termp_lk_pre(DECL_ARGS)
{
const struct roff_node *link, *descr;
+ int display;
if (NULL == (link = n->child))
return 0;
@@ -2006,10 +2007,19 @@ termp_lk_pre(DECL_ARGS)
term_word(p, ":");
}
+ display = term_strlen(p, link->string) >= 26;
+ if (display) {
+ term_newln(p);
+ p->offset += term_len(p, p->defindent + 1);
+ }
+
term_fontpush(p, TERMFONT_BOLD);
term_word(p, link->string);
term_fontpop(p);
+ if (display)
+ term_newln(p);
+
return 0;
}