diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2020-04-07 22:56:02 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2020-04-07 22:56:02 +0000 |
commit | 78bf8cb3c86e47d614af8f2629bdc00e459cf758 (patch) | |
tree | d8d6f94069f3e5d03420e282492ea5c7206af2f8 /tree.c | |
parent | b19e09dbeb7e957bca580776d8b3a4651016c904 (diff) | |
download | mandoc-78bf8cb3c86e47d614af8f2629bdc00e459cf758.tar.gz |
Separate the place to put the <a href> 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.
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |