commit 1ebb7ceb0d8d1e6a521913f38003908bc21bd571 from: Omar Polo date: Mon Jan 17 09:38:36 2022 UTC fix parsing of invalid link lines Links lines without an URL may crash Telescope if the emojify-link option is enabled (which is by default.) Since URLs are mandatory in link lines, parse these invalid lines as empty text lines (lagrange and phos parses them as text lines with "=>".) thanks @aartaka for unknowingly helping finding this issue, see https://github.com/omar-polo/phos/pull/5 commit - 2e44d6be3e7033f0206cd6584ff31953aedc76a9 commit + 1ebb7ceb0d8d1e6a521913f38003908bc21bd571 blob - 9c5b7240f6f131a06cbfd8cac472f04d3d6b95a2 blob + e772078332f5f233f43f5e6af086619664ed3d8f --- parser_gemtext.c +++ parser_gemtext.c @@ -130,7 +130,7 @@ parse_link(struct parser *p, enum line_type t, const c const char *url_start; if (len <= 2) - return emit_line(p, t, NULL, NULL); + return emit_line(p, LINE_TEXT, NULL, NULL); buf += 2; len -= 2; @@ -140,7 +140,7 @@ parse_link(struct parser *p, enum line_type t, const c } if (len == 0) - return emit_line(p, t, NULL, NULL); + return emit_line(p, LINE_TEXT, NULL, NULL); url_start = buf; while (len > 0 && !isspace(buf[0])) {