commit f29fe8ca012dc654c1f2bfc831cbf71699c6a06d from: Omar Polo date: Fri Jul 16 15:21:25 2021 UTC don't stop at empty headings and use url if no text for link commit - 1247b8cc41193a0a7136e6549c133cf0d8dd303b commit + f29fe8ca012dc654c1f2bfc831cbf71699c6a06d blob - f248a4bc4328eda9e59316ef8ae08c7a90634dc4 blob + 0a7c493876aeb1857676c6804221a0a410059e95 --- compl.c +++ compl.c @@ -76,7 +76,9 @@ compl_ls(void **data, void **ret) if (l == NULL) return NULL; - link = l->line; + if ((link = l->line) == NULL) + link = l->alt; + *ret = l; *line = TAILQ_NEXT(l, lines); return link; @@ -114,10 +116,10 @@ compl_toc(void **data, void **ret) const char *text; l = *line; - while (l != NULL && - l->type != LINE_TITLE_1 && + while (l != NULL && (l->line == NULL || + (l->type != LINE_TITLE_1 && l->type != LINE_TITLE_2 && - l->type != LINE_TITLE_3) + l->type != LINE_TITLE_3))) l = TAILQ_NEXT(l, lines); /* end of buffer */