texinfo-commits
[Top][All Lists]
Advanced

[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:22 -0400 (EDT)

branch: master
commit 4658bb51ab238662f716203edb3a05d4c2c90108
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Oct 21 12:56:55 2019 +0100

    strip html tags from toc
---
 js/infog/main.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/js/infog/main.c b/js/infog/main.c
index c1ce13b78a..8192f8286b 100644
--- a/js/infog/main.c
+++ b/js/infog/main.c
@@ -256,6 +256,19 @@ load_toc (char *p)
       *q2++ = 0;
       debug (2, "add toc entry %s:%s\n", p, q);
 
+      if (strchr (p, '<'))
+       {
+          /* Strip HTML tags. */
+          char *p1, *p2;
+          char *q3 = q2;
+          while ((p1 = strchr (p, '<')) && (p2 = strchr (p1, '>')))
+            {
+              p2++;
+              memmove (p1, p2, q3 - p2);
+              q3 -= p2 - p1;
+            }
+        }
+
       gtk_tree_store_append (toc_store, &iter, NULL);
       gtk_tree_store_set (toc_store, &iter,
                           0, p, 1, q, -1);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]