aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-04-14 19:35:22 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-04-14 19:35:22 +0000
commit1c62f42ca2f43ac9f721ae986079d2bb30403fd3 (patch)
tree3159fdbc400fff86512ae6db21712482e1d97b5b /mdoc_term.c
parent2f432db9c51ac711c0029344f3013254cb66eff9 (diff)
downloadmandoc-1c62f42ca2f43ac9f721ae986079d2bb30403fd3.tar.gz
mandoc-1c62f42ca2f43ac9f721ae986079d2bb30403fd3.tar.zst
mandoc-1c62f42ca2f43ac9f721ae986079d2bb30403fd3.zip
Show long .Lk URIs in like an indented display, similar to groff.
Suggested by bentley@.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 18183a31..259f9a2e 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.347 2017/04/14 18:25:04 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.348 2017/04/14 19:35:22 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1993,6 +1993,7 @@ static int
termp_lk_pre(DECL_ARGS)
{
const struct roff_node *link, *descr;
+ int display;
if (NULL == (link = n->child))
return 0;
@@ -2008,10 +2009,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;
}