X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/d532c4d1612c94347427fa1afda6afb7c34e512a..5b27248301db4b246bcd9977c6c3d2d4497b9ecb:/html.c diff --git a/html.c b/html.c index 36e9a2f..d7d9fd7 100644 --- a/html.c +++ b/html.c @@ -128,6 +128,38 @@ void html_attr(char *txt) html(txt); } +void html_url_path(char *txt) +{ + char *t = txt; + while(t && *t){ + int c = *t; + if (c=='"' || c=='#' || c=='\'' || c=='?') { + write(htmlfd, txt, t - txt); + write(htmlfd, fmt("%%%2x", c), 3); + txt = t+1; + } + t++; + } + if (t!=txt) + html(txt); +} + +void html_url_arg(char *txt) +{ + char *t = txt; + while(t && *t){ + int c = *t; + if (c=='"' || c=='#' || c=='%' || c=='&' || c=='\'' || c=='+' || c=='?') { + write(htmlfd, txt, t - txt); + write(htmlfd, fmt("%%%2x", c), 3); + txt = t+1; + } + t++; + } + if (t!=txt) + html(txt); +} + void html_hidden(char *name, char *value) { html("