Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Percent-encode a clone url in its href
An href carried git://example.org/dépôt.git as it was, and the space
of "with space" too, neither of which a url may hold. html_url_path
would also encode the plus of git+ssh, which breaks the scheme, and the
percent of an escape the url was written with, so a whole url gets a
helper that encodes only the bytes RFC 3986 allows nowhere.
Diffstat (limited to 'source/html.h')
| -rw-r--r-- | source/html.h | 7 |
1 file changed, 7 insertions, 0 deletions
diff --git a/source/html.h b/source/html.h index d3cd8fe..4c16f85 100644 --- a/source/html.h +++ b/source/html.h @@ -84,6 +84,13 @@ extern void html_url_path(const char *txt); */ extern void cgit_add_url_path(struct strbuf *sb, const char *txt); +/* + * Escape a whole url given in the configuration, such as a clone url, for an + * attribute value. Only a byte no url may carry is percent-encoded, so the + * scheme, the delimiters and any escape the url was written with are kept. + */ +extern void html_attr_url(const char *txt); + extern void html_url_arg(const char *txt); extern void html_header_arg_in_quotes(const char *txt); extern void html_header_query(const char *txt); |
