Skip to content

Commit

Permalink
topics: replace white space in keyword anchors with dash
Browse files Browse the repository at this point in the history
  • Loading branch information
neteler committed Dec 6, 2024
1 parent 52ed593 commit 99a40f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/gis/parser_rest_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ void print_escaped_for_md_keywords(FILE *f, const char *str)
str_s = G_store(str);
G_strip(str_s);

/* HTML link only for second keyword */
/* HTML link only for second keyword = topic */
if (st->n_keys > 1 && strcmp(st->module_info.keywords[1], str) == 0) {

const char *s;
Expand Down Expand Up @@ -535,7 +535,7 @@ void print_escaped_for_md_keywords(FILE *f, const char *str)
fprintf(f, ".md)");
}
else {
/* keyword index */
/* keyword index, mkdocs expects dash */
char *str_link;
str_link = G_str_replace(str_s, " ", "-");
G_str_to_lower(str_link);
Expand Down
2 changes: 1 addition & 1 deletion man/build_topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def build_topics(ext):
"*See also the corresponding keyword"
" [{key}](keywords.md#{key})"
" for additional references.*\n".format(
key=key.replace("_", "-").lower()
key=key.replace(" ", "-").replace("_", "-").lower()
)
)

Expand Down

0 comments on commit 99a40f1

Please sign in to comment.