diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-05-29 19:38:43 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-05-29 19:38:43 -0700 |
commit | 10e1cc59ba222b463661fe01b0b783a2b8d49112 (patch) | |
tree | c903d0c95c61ce785faedd16fe27392e27b50e0e /test | |
parent | 271e541893c4d10b3b4fa8f20cb6c54f0af2527e (diff) | |
download | tl-who-10e1cc59ba222b463661fe01b0b783a2b8d49112.tar.gz tl-who-10e1cc59ba222b463661fe01b0b783a2b8d49112.tar.bz2 tl-who-10e1cc59ba222b463661fe01b0b783a2b8d49112.zip |
New local macro noesc-fmt; fmt now escapes.
* packages.tl (tl-who): Add noesc-fmt symbol.
* who.tl (with-html-output): Add escaping to fmt,
which is disabled under *cl-who-compat*.
Add noesc-fmt macro that looks like former definition
of fmt.
* test/simple.tl: New test cases 38-40.
* README.md: Mention that TL-WHO provides noesc-fmt.
Diffstat (limited to 'test')
-rw-r--r-- | test/simple.tl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/simple.tl b/test/simple.tl index 7645901..3601814 100644 --- a/test/simple.tl +++ b/test/simple.tl @@ -430,3 +430,22 @@ (with-html-output-to-string (out) (:foo :bar (noesc attr-val))))) "<foo bar=''blah<tag>'></foo>") + +;;; 38 +;;; Test noesc-fmt +(test (with-html-output-to-string (out) + (:foo (noesc-fmt "<a href=\"foo.html\">click</a>"))) + "<foo><a href=\"foo.html\">click</a></foo>") + +;;; 39 +;;; Test that fmt escapes +(test (with-html-output-to-string (out) + (:foo (fmt "<a href=\"foo.html\">click</a>"))) + "<foo><a href=\"foo.html\">click</a></foo>") + +;;; 40 +;;; Test that fmt doesn't escape under *cl-who-compat* +(test (expander-let ((*cl-who-compat* t)) + (with-html-output-to-string (out) + (:foo (fmt "<a href=\"foo.html\">click</a>")))) + "<foo><a href=\"foo.html\">click</a></foo>") |