html escape
git-svn-id: file:///raid/svn-personal/keine/trunk@9 a3977ea8-0dc0-2842-9144-a1a46b47fd40
This commit is contained in:
parent
b043eccdd9
commit
ee3533e420
|
@ -63,6 +63,8 @@ bool kn_has_manpage(const char* str) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define HTML(buf) (buf[0] == '<' ? "<" : (buf[0] == '>' ? ">" : (buf[0] == '&' ? "&" : buf)))
|
||||||
|
|
||||||
char* kn_manpage_process(const char* path) {
|
char* kn_manpage_process(const char* path) {
|
||||||
char* b = malloc(1);
|
char* b = malloc(1);
|
||||||
b[0] = 0;
|
b[0] = 0;
|
||||||
|
@ -107,7 +109,7 @@ char* kn_manpage_process(const char* path) {
|
||||||
m = 0;
|
m = 0;
|
||||||
cbuf[0] = s;
|
cbuf[0] = s;
|
||||||
tmp = b;
|
tmp = b;
|
||||||
b = kn_strcat(b, cbuf);
|
b = kn_strcat(b, HTML(cbuf));
|
||||||
free(tmp);
|
free(tmp);
|
||||||
} else {
|
} else {
|
||||||
if(old == s) {
|
if(old == s) {
|
||||||
|
@ -125,7 +127,7 @@ char* kn_manpage_process(const char* path) {
|
||||||
}
|
}
|
||||||
m = 'B';
|
m = 'B';
|
||||||
tmp = b;
|
tmp = b;
|
||||||
b = kn_strcat(b, cbuf);
|
b = kn_strcat(b, HTML(cbuf));
|
||||||
free(tmp);
|
free(tmp);
|
||||||
} else if(old == '_') {
|
} else if(old == '_') {
|
||||||
cbuf[0] = s;
|
cbuf[0] = s;
|
||||||
|
@ -141,7 +143,7 @@ char* kn_manpage_process(const char* path) {
|
||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
tmp = b;
|
tmp = b;
|
||||||
b = kn_strcat(b, cbuf);
|
b = kn_strcat(b, HTML(cbuf));
|
||||||
free(tmp);
|
free(tmp);
|
||||||
tmp = b;
|
tmp = b;
|
||||||
b = kn_strcat(b, "</u>");
|
b = kn_strcat(b, "</u>");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user