1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

no textdb proliferation necessary

This commit is contained in:
psyc://psyced.org/~lynX 2010-03-01 17:46:42 +01:00
parent c2aa52adfa
commit b9ac38a361
4 changed files with 32 additions and 19 deletions

View file

@ -4,15 +4,16 @@
// html-escaping of generic strings -lynx
// to make sure they won't trigger
// html commands
// 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.
//
varargs string htquote(string s, int newlines) {
varargs string htquote(string s) {
ASSERT("htquote", stringp(s), s)
s = replace(s, "&", "&");
// s = replace(s, "\"", """); //"
s = replace(s, "<", "&lt;");
s = replace(s, ">", "&gt;");
if (newlines) s = replace(s, "\n", "<br>\n");
return s;
}