diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | test/simple.tl | 6 | ||||
-rw-r--r-- | who.tl | 4 |
3 files changed, 11 insertions, 2 deletions
@@ -192,6 +192,9 @@ Here are the differences to be aware of: a Javascript string literal, which is itself embedded in a HTML `script` tag. +* TL-WHO's `esc` accepts arguments which are not strings. They + are turned to a string using `tostringp`, and HTML-escaped. + Additionally, users (of CL-WHO and TL-WHO alike) are advised to watch for the following issue: the CL-WHO documentation is not accurately maintained and makes some references to material that no longer exists in CL-WHO, such as the diff --git a/test/simple.tl b/test/simple.tl index 8b8cb50..3ed4685 100644 --- a/test/simple.tl +++ b/test/simple.tl @@ -474,3 +474,9 @@ (test (with-html-output-to-string (out) (:script "var x = \"" (escj "\"</script>\t") "\"")) "<script>var x = \"\\\"<\\/script>\\t\"</script>") + +;;; 44 +;;; Test that esc, escq and escj allow non-string. +(test (with-html-output-to-string (out) + (:p (esc 5) (escq 6) (escj 7))) + "<p>567</p>") @@ -258,11 +258,11 @@ (esc (thing) (with-gensyms (result) ^(whenlet ((,result ,thing)) - (put-string (html-encode* ,result) ,',var)))) + (put-string (html-encode* (tostringp ,result)) ,',var)))) (escq (thing) (with-gensyms (result) ^(whenlet ((,result ,thing)) - (put-string (html-encode ,result) ,',var)))) + (put-string (html-encode (tostringp ,result)) ,',var)))) (escj (thing) (with-gensyms (result) ^(whenlet ((,result ,thing)) |