Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ full_regex_t re_man, re_http, re_email, re_file;
(L'T' == gline[1] || L't' == gline[1]) && \
(L'P' == gline[2] || L'p' == gline[2]))

// true if `gline` is a standard paragraph
#define got_pp \
((glen >= 3) && (L'.' == gline[0]) && \
(L'P' == gline[1] || L'p' == gline[1]) && \
(L'P' == gline[2] || L'p' == gline[2]))

// true if `gline` is a command to output delayed text
#define got_pd \
((glen >= 3) && (L'.' == gline[0]) && \
Expand Down Expand Up @@ -2191,15 +2197,15 @@ unsigned man_toc(toc_entry_t **dst, const wchar_t *args, bool local_file) {
wmargtrim(res[en].text, L"\"");
inc_en;
}
} else if (!gm && got_tp && sh_seen) {
} else if (!gm && (got_tp || got_pp) && sh_seen) {
// Tagged paragraph
argets(gp, tmp, BS_LINE);
if (!areof(gp)) {
glen = xmbstowcs(gline, tmp, BS_LINE);
{
// Edge case: the tag line contains only a comment or a line that
// must otherwise be skipped; skip to next line
while (got_comment || got_tp || got_pd) {
while (got_comment || got_tp || got_pp || got_pd) {
argets(gp, tmp, BS_LINE);
if (areof(gp))
break;
Expand Down