From f4c07cc80595b2276a99fd6e5c95c734187feaab Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 7 Apr 2020 22:56:02 +0000 Subject: Separate the place to put the permalink (now marked with NODE_HREF) from the target element of the link (still marked with NODE_ID). In many cases, use this to move the target to the beginning of the paragraph, such that readers don't get dropped into the middle of a sentence. --- tree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index f08695d3..b901be1a 100644 --- a/tree.c +++ b/tree.c @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.87 2020/03/13 15:32:29 schwarze Exp $ */ +/* $Id: tree.c,v 1.88 2020/04/07 22:56:02 schwarze Exp $ */ /* * Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons @@ -207,8 +207,11 @@ print_mdoc(const struct roff_node *n, int indent) if (n->string != NULL) printf("=%s", n->string); } - if (n->flags & NODE_HREF) + if (n->flags & NODE_HREF) { printf(" HREF"); + if (n->string != NULL && (n->flags & NODE_ID) == 0) + printf("=%s", n->string); + } if (n->flags & NODE_BROKEN) printf(" BROKEN"); if (n->flags & NODE_NOFILL) -- cgit v1.2.3