[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 20 Mar 2022 04:55:21 -0400 (EDT) |
branch: master
commit cf95f205d74a853366f5b1f71420a762fbb9a881
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Oct 18 19:29:57 2019 +0100
send hrefs for toc
---
js/infog/extension.c | 4 ++++
js/infog/main.c | 12 ++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/js/infog/extension.c b/js/infog/extension.c
index 34e6231731..027fbe1770 100644
--- a/js/infog/extension.c
+++ b/js/infog/extension.c
@@ -328,6 +328,10 @@ send_toc (WebKitDOMDocument *dom_document)
s3 = webkit_dom_element_get_inner_html (e1);
g_string_append (toc, s3);
g_string_append (toc, "\n");
+
+ s3 = webkit_dom_element_get_attribute (e1, "href");
+ g_string_append (toc, s3);
+ g_string_append (toc, "\n");
}
}
diff --git a/js/infog/main.c b/js/infog/main.c
index 758b4cd3a4..dd17162a1d 100644
--- a/js/infog/main.c
+++ b/js/infog/main.c
@@ -234,7 +234,7 @@ load_toc (char *p)
if (!toc_store)
{
- toc_store = gtk_list_store_new (1, G_TYPE_STRING);
+ toc_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
gtk_tree_view_set_model (toc_pane, GTK_TREE_MODEL(toc_store));
toc_renderer = gtk_cell_renderer_text_new ();
@@ -249,13 +249,17 @@ load_toc (char *p)
while ((q = strchr (p, '\n')))
{
*q++ = 0;
- debug (1, "add toc entry %s\n", p);
+ q2 = strchr (q, '\n');
+ if (!q2)
+ break;
+ *q2++ = 0;
+ debug (1, "add toc entry %s:%s\n", p, q);
gtk_list_store_append (toc_store, &iter);
gtk_list_store_set (toc_store, &iter,
- 0, p, -1);
+ 0, p, 1, q, -1);
- p = q;
+ p = q2;
}
}
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20