2009-01-26 19:21:29 +00:00
|
|
|
// $Id: htbasics.c,v 1.5 2007/06/28 20:17:50 lynx Exp $ // vim:syntax=lpc
|
|
|
|
#include <net.h>
|
|
|
|
#include <ht/http.h>
|
|
|
|
|
|
|
|
// html-escaping of generic strings -lynx
|
|
|
|
// to make sure they won't trigger
|
2010-03-01 16:46:42 +00:00
|
|
|
// html commands. this should become an inline macro, maybe use
|
|
|
|
// regreplace if that is faster, or even better, be implemented in C
|
|
|
|
// together with an auto hyperlink and a linebreak conversion option.
|
2009-01-26 19:21:29 +00:00
|
|
|
//
|
2010-03-01 16:46:42 +00:00
|
|
|
varargs string htquote(string s) {
|
2009-01-26 19:21:29 +00:00
|
|
|
ASSERT("htquote", stringp(s), s)
|
|
|
|
s = replace(s, "&", "&");
|
|
|
|
// s = replace(s, "\"", """); //"
|
|
|
|
s = replace(s, "<", "<");
|
|
|
|
s = replace(s, ">", ">");
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HTTP_PATH
|
|
|
|
# include HTTP_PATH "library.i"
|
|
|
|
#endif
|