X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/6cb326c83b3c0b35d472305294afee3105b3088d..e5ca46bf4b974ce3b51d09da4c7ad741aaa70ede:/html.c
diff --git a/html.c b/html.c
index 8a69659..339bf00 100644
--- a/html.c
+++ b/html.c
@@ -45,12 +45,10 @@ void htmlf(const char *format, ...)
void html_txt(char *txt)
{
char *t = txt;
- while(*t){
+ while(t && *t){
int c = *t;
if (c=='<' || c=='>' || c=='&') {
- *t = '\0';
- html(txt);
- *t = c;
+ write(htmlfd, txt, t - txt);
if (c=='>')
html(">");
else if (c=='<')
@@ -65,16 +63,36 @@ void html_txt(char *txt)
html(txt);
}
+void html_ntxt(int len, char *txt)
+{
+ char *t = txt;
+ while(t && *t && len--){
+ int c = *t;
+ if (c=='<' || c=='>' || c=='&') {
+ write(htmlfd, txt, t - txt);
+ if (c=='>')
+ html(">");
+ else if (c=='<')
+ html("<");
+ else if (c=='&')
+ html("&");
+ txt = t+1;
+ }
+ t++;
+ }
+ if (t!=txt)
+ write(htmlfd, txt, t - txt);
+ if (len<0)
+ html("...");
+}
void html_attr(char *txt)
{
char *t = txt;
- while(*t){
+ while(t && *t){
int c = *t;
if (c=='<' || c=='>' || c=='\'') {
- *t = '\0';
- html(txt);
- *t = c;
+ write(htmlfd, txt, t - txt);
if (c=='>')
html(">");
else if (c=='<')
@@ -89,6 +107,27 @@ void html_attr(char *txt)
html(txt);
}
+void html_hidden(char *name, char *value)
+{
+ html("");
+}
+
+void html_option(char *value, char *text, char *selected_value)
+{
+ html("\n");
+}
+
void html_link_open(char *url, char *title, char *class)
{
html("