aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-06-23 18:37:57 +0200
committerOmar Polo <op@omarpolo.com>2021-06-23 18:37:57 +0200
commitf2d2d7a162a2dc8ab5737f477fb0c9aab2673566 (patch)
treecb386ecd13ed734cd207cf9cadb967cf967b9ae5
parent984245ce20826f010570cf6fe030c19a1b566311 (diff)
downloadtelescope-f2d2d7a162a2dc8ab5737f477fb0c9aab2673566.tar.gz
telescope-f2d2d7a162a2dc8ab5737f477fb0c9aab2673566.tar.bz2
fix the tab title heuristic
the *last* level 2 or 3 heading would be used as tab title instead of the first one.
-rw-r--r--ChangeLog2
-rw-r--r--gemtext.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 924d679..e6e22f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2021-06-23 Omar Polo <op@omarpolo.com>
+ * gemtext.c (search_title): fixed a bug where the *last* level 2 or 3 heading would be used as tab title instead of the first one.
+
* parse.y (add_proxy): add proxy support (e.g. `proxy http via gemini://localhost:1965' for the duckling proxy)
* cmd.c (cmd_previous_button): stay on the line in next-button if there is no next link, and the same for previous-button
diff --git a/gemtext.c b/gemtext.c
index 15d892d..d6d6ce9 100644
--- a/gemtext.c
+++ b/gemtext.c
@@ -393,6 +393,7 @@ search_title(struct parser *p, enum line_type level)
if (l->line == NULL)
continue;
strlcpy(p->title, l->line, sizeof(p->title));
+ break;
}
}
}