Skip to content

Commit

Permalink
lib/gis: markdown parser lowercase and extension fixes (#4740)
Browse files Browse the repository at this point in the history
This PR updates the Markdown support in the parser for the manual in terms of

- converting keywords to lowercase (e.g. `dist.x86_64-pc-linux-gnu/docs/mkdocs/site/keywords.html#modis`)
- replacing of `.html` with `.md` in certain cases
  • Loading branch information
neteler authored Nov 23, 2024
1 parent f1093bd commit e7ae0b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/gis/parser_rest_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ void print_escaped_for_md_keywords(FILE *f, const char *str)
fputc(*s, f);
}
}
fprintf(f, ".html)");
fprintf(f, ".md)");
}
else { /* first and other than second keyword */
if (st->n_keys > 0 && strcmp(st->module_info.keywords[0], str) == 0) {
Expand All @@ -532,13 +532,14 @@ void print_escaped_for_md_keywords(FILE *f, const char *str)
fputc(*s, f);
}
}
fprintf(f, ".html)");
fprintf(f, ".md)");
}
else {
/* keyword index */
char *str_link;
str_link = G_str_replace(str_s, " ", "%20");
fprintf(f, "[%s](keywords.html#%s)", str_s, str_link);
G_str_to_lower(str_link);
fprintf(f, "[%s](keywords.md#%s)", str_s, str_link);
G_free(str_link);
}
}
Expand Down

0 comments on commit e7ae0b8

Please sign in to comment.