In some cases, a single href can be propagated to multiple nodes. Search
through previous hints to avoid hinting the same href twice.
Minimal reproduction:
<body>
<a href="foo">bar&baz</a>
---
I tested this and made sure that both gadgets and multiple hints with
the same target still work
frontends/visurf/commands.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/frontends/visurf/commands.c b/frontends/visurf/commands.c
index 2541d7fbe..6b12e362b 100644
--- a/frontends/visurf/commands.c+++ b/frontends/visurf/commands.c
@@ -171,6 +171,12 @@ follow_collect_hints(struct gui_window *win, struct box *node, int x, int y)
{
struct follow_state *follow = &win->follow;
if ((node->href || node->gadget) && node->width > 0 && node->height > 0) {
+ for (size_t i = 0; i < follow->nhint; i++) {+ if (node->href == follow->hints[i].node->href+ && node->href != NULL) {+ goto end;+ }+ } if (!follow->hints) {
follow->hints = calloc(64, sizeof(struct link_hint));
follow->nhint = 0;
@@ -188,6 +194,8 @@ follow_collect_hints(struct gui_window *win, struct box *node, int x, int y)
hint->node = node;
++follow->nhint;
}
++end: for (struct box *child = node->children; child; child = child->next) {
follow_collect_hints(win, child, x + node->x, y + node->y);
}
--
2.35.1