From 8e1337bc8ff4b58f75087f9cf4d4fb9a293a39e2 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Fri, 17 Apr 2020 00:57:11 +0200 Subject: [PATCH] Add links to the nodes in the thread graph Currently it's just the nodes themselves which are kind of tiny and hard to hit. Probably should add some invisible overlay. --- mbox2web | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mbox2web b/mbox2web index cd18196..f374818 100755 --- a/mbox2web +++ b/mbox2web @@ -1053,7 +1053,7 @@ class Thread: if y == 0: # first message in thread # Just add a node - nodes.append((x, y)) + nodes.append((x, y, m.encmsgid)) m.x = x m.y = y else: @@ -1064,7 +1064,7 @@ class Thread: # or Thread-Index) # Just start a new column to get out of the way x += 1 - nodes.append((x, y)) + nodes.append((x, y, m.encmsgid)) m.x = x m.y = y @@ -1085,7 +1085,7 @@ class Thread: # Just put the new kid directly below the parent m.x = p.x m.y = y - nodes.append((m.x, m.y)) + nodes.append((m.x, m.y, m.encmsgid)) edges.append((p.x, p.y, m.x, m.y)) p.kids = True else: @@ -1096,7 +1096,7 @@ class Thread: x += 1 m.x = x m.y = y - nodes.append((m.x, m.y)) + nodes.append((m.x, m.y, m.encmsgid)) for r in m.in_reply_to: p = self.messages[r] edges.append((p.x, p.y, m.x, m.y)) @@ -1120,19 +1120,21 @@ class Thread: yc = e[1] + 1 s += f"" for n in nodes: + s += f"" s += f"" + s += f"" s += "" s += "" # XXX - escape! - s += f"{lines[0][0]}" + s += f"{lines[0][0]}" s += f"{html.escape(lines[0][1])}" s += f"{html.escape(lines[0][2])}" s += "" for ln in lines[1:]: s += "" - s += f"{ln[0]}" + s += f"{ln[0]}" s += f"{html.escape(ln[1])}" s += f"{html.escape(ln[2])}" s += ""