From: schwarze Date: Fri, 14 Apr 2017 19:34:54 +0000 (+0000) Subject: Show long .Lk URIs in like an indented display, similar to groff. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=97970a6243cf0d263a65c4fd1bd4c20caa2ef554;p=openbsd Show long .Lk URIs in like an indented display, similar to groff. Suggested by bentley@. --- 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 * Copyright (c) 2010, 2012-2017 Ingo Schwarze @@ -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; }