From b430fd4e3f1cc2f2ba1d58b77eee8d527f3b3cf7 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 19:34:05 -1000 Subject: Percent-encode a submodule path in its link A module-link template takes the path as the tree names it, so a path holding a space or a byte past ASCII gave an href that broke there. The url is now encoded the way a clone url is. --- source/ui-shared.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index d2eec25..c64cd9a 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1210,7 +1210,10 @@ static void emit_module_link(const char *tmpl, const char **args, int nargs) strbuf_addch(&sb, '%'); } } - html_attr(sb.buf); + // The path comes from the tree as it is, and a space or a byte past + // ASCII in it would break the href, so the url is encoded as a clone + // url is. + html_attr_url(sb.buf); strbuf_release(&sb); } -- cgit 2.12.1