# HG changeset patch # User Adam Chlipala # Date 1262360976 18000 # Node ID 82ac88b4e0a7eef9cff655cdbf2263f6f52ca18b # Parent 52571ca9b7770184e0a7173f19f50c7ed6ef09be Proper client-side attrifyString diff -r 52571ca9b777 -r 82ac88b4e0a7 lib/js/urweb.js --- a/lib/js/urweb.js Thu Dec 31 18:07:53 2009 -0500 +++ b/lib/js/urweb.js Fri Jan 01 10:49:36 2010 -0500 @@ -603,6 +603,10 @@ return decodeURIComponent(s.replace(new RegExp ("\\+", "g"), " ")); } +function atr(s) { + return s.replace(new RegExp ("\"", "g"), """).replace(new RegExp ("&", "g"), "&") +} + function ub(b) { return b ? "1" : "0"; } diff -r 52571ca9b777 -r 82ac88b4e0a7 src/settings.sml --- a/src/settings.sml Thu Dec 31 18:07:53 2009 -0500 +++ b/src/settings.sml Fri Jan 01 10:49:36 2010 -0500 @@ -158,7 +158,7 @@ ("onConnectFail", "onConnectFail"), ("onDisconnect", "onDisconnect"), ("onServerError", "onServerError"), - ("attrifyString", "escape"), + ("attrifyString", "atr"), ("attrifyInt", "ts"), ("attrifyFloat", "ts"), ("attrifyBool", "bs"), diff -r 52571ca9b777 -r 82ac88b4e0a7 tests/sendurl.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/sendurl.ur Fri Jan 01 10:49:36 2010 -0500 @@ -0,0 +1,11 @@ +fun main () = + let + fun getIt () = return (bless "http://www.yahoo.com/") + in + s <- source ; + return + + +