summaryrefslogtreecommitdiffstats
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
commit9fa2ec46cdd419a9476abc763c485548e4d59d66 (patch)
tree445ad1ebeb9120f683b84e2894eacd9ebdefcda5 /mdoc_term.c
parent841d7338bd8aa6b12ade50a315c5d1f58ddf037a (diff)
downloadmandoc-9fa2ec46cdd419a9476abc763c485548e4d59d66.tar.gz
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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index ea4a6a31..fa6301ed 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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;
}