From e7ae0b832cd2febc50078d36f137f8bae44d5e8c Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Sat, 23 Nov 2024 15:14:06 +0100 Subject: [PATCH] lib/gis: markdown parser lowercase and extension fixes (#4740) 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 --- lib/gis/parser_rest_md.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/gis/parser_rest_md.c b/lib/gis/parser_rest_md.c index c607acc4214..a5c74874202 100644 --- a/lib/gis/parser_rest_md.c +++ b/lib/gis/parser_rest_md.c @@ -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) { @@ -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); } }