X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a36a0d9dec8a3ba79501d2526d648e44306f0fdd..9f9ede3d924fc363d6b8d59bea5a668569175a23:/html.c diff --git a/html.c b/html.c index 167127f..66ba65d 100644 --- a/html.c +++ b/html.c @@ -112,14 +112,32 @@ void html_attr(char *txt) char *t = txt; while(t && *t){ int c = *t; - if (c=='<' || c=='>' || c=='\'') { + if (c=='<' || c=='>' || c=='\'' || c=='\"') { write(htmlfd, txt, t - txt); if (c=='>') html(">"); else if (c=='<') html("<"); else if (c=='\'') - html(""e;"); + html("'"); + else if (c=='"') + html("""); + txt = t+1; + } + t++; + } + if (t!=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++;