psyced/world/net/library/htbasics.c
Gabor Adam Toth 58bcc84430 place/threads: use _log to store data, threaded comments
place/archetype.gen: new save log immediately flag to save() after logAppend():
- in place/name.c:
define SAVE_LOG_IMMEDIATELY
- in local.h:
define _flag_save_place_log_immediately
define _flag_save_userthreads_immediately

place/text: added x()
2010-02-27 23:58:32 +01:00

22 lines
577 B
C

// $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
// html commands
//
varargs string htquote(string s, int newlines) {
ASSERT("htquote", stringp(s), s)
s = replace(s, "&", "&amp;");
// s = replace(s, "\"", "&quot;"); //"
s = replace(s, "<", "&lt;");
s = replace(s, ">", "&gt;");
if (newlines) s = replace(s, "\n", "<br>\n");
return s;
}
#ifdef HTTP_PATH
# include HTTP_PATH "library.i"
#endif