Use cl-str instead

This commit is contained in:
Akira Tempaku 2024-10-04 08:44:27 +09:00
parent 53a6a8f50e
commit 7ce7751900
6 changed files with 26 additions and 34 deletions

View file

@ -89,6 +89,7 @@
nil
"bar")))
:pretty t))))
(testing "self-closing-tag"
(ok (string= "<img src=\"/background.png\">"
(render-to-string (create-element :img
@ -137,7 +138,18 @@
(create-element :li
nil
(list "brah"))))
:pretty t))))))
:pretty t)))))
(testing "minify-props-text"
(let ((elm (create-element :div
'(:x-data "{
open: false,
get isOpen() { return this.open },
toggle() { this.open = ! this.open },
}")
nil)))
(ok (string= (render-to-string elm)
"<div x-data=\"{ open: false, get isOpen() { return this.open }, toggle() { this.open = ! this.open }, }\"></div>")))))
(defun comp1 (&key prop children)
(create-element :div

View file

@ -11,16 +11,7 @@
(testing "escape-html-text-content"
(ok (string= "&amp;&lt;&gt;&quot;&#x27;&#x2F;&grave;&#x3D;"
(escape-html-text-content "&<>\"'/`="))))
(testing "minify"
;; Test with Alpine.js
(ok (string= (minify "{
open: false,
get isOpen() { return this.open },
toggle() { this.open = ! this.open },
}")
"{ open: false, get isOpen() { return this.open }, toggle() { this.open = ! this.open }, }"))))
(escape-html-text-content "&<>\"'/`=")))))
(defgroup fruit
apple banana)