Unidiff1 files changed, 28 insertions, 0 deletions
|
diff --git a/html.c b/html.c index 8a69659..957b326 100644 --- a/ html.c+++ b/ html.c |
|
@@ -62,12 +62,40 @@ void html_txt(char *txt) |
62 | t++; |
62 | t++; |
63 | } |
63 | } |
64 | if (t!=txt) |
64 | if (t!=txt) |
65 | html(txt); |
65 | html(txt); |
66 | } |
66 | } |
67 | |
67 | |
| |
68 | void html_ntxt(int len, char *txt) |
| |
69 | { |
| |
70 | char *t = txt; |
| |
71 | while(*t && len--){ |
| |
72 | int c = *t; |
| |
73 | if (c=='<' || c=='>' || c=='&') { |
| |
74 | *t = '\0'; |
| |
75 | html(txt); |
| |
76 | *t = c; |
| |
77 | if (c=='>') |
| |
78 | html(">"); |
| |
79 | else if (c=='<') |
| |
80 | html("<"); |
| |
81 | else if (c=='&') |
| |
82 | html("&"); |
| |
83 | txt = t+1; |
| |
84 | } |
| |
85 | t++; |
| |
86 | } |
| |
87 | if (t!=txt) { |
| |
88 | char c = *t; |
| |
89 | *t = '\0'; |
| |
90 | html(txt); |
| |
91 | *t = c; |
| |
92 | } |
| |
93 | if (len<0) |
| |
94 | html("..."); |
| |
95 | } |
68 | |
96 | |
69 | void html_attr(char *txt) |
97 | void html_attr(char *txt) |
70 | { |
98 | { |
71 | char *t = txt; |
99 | char *t = txt; |
72 | while(*t){ |
100 | while(*t){ |
73 | int c = *t; |
101 | int c = *t; |
|