squint

borkdude 2024-06-27T10:44:20.520449Z

New squint version: 0.8.112 which has more safe HTML generation. Previously dynamic HTML children weren't escaped. Also nested HTML expressions aren't double escaped. Both are lessons from the https://github.com/borkdude/html library so porting this to a standalone library paid off even if the library itself wouldn't be used :-) Here is a https://squint-cljs.github.io/squint/?src=KGRlZiB4ICNodG1sIFs6ZGl2IFs6YnJdICJEdWRlITw%2BIl0pCgooZGVmIHkgI2h0bWwgWzpkaXYgeCBbOnAgIkVPRiJdXSkKCihkZWYgYXBwIChvciAoanMvZG9jdW1lbnQucXVlcnlTZWxlY3RvciAiI2FwcCIpCiAgICAgICAgICAgKGRvdG8gKGpzL2RvY3VtZW50LmNyZWF0ZUVsZW1lbnQgImRpdiIpCiAgICAgICAgICAgICAoc2V0ISAtaWQgImFwcCIpCiAgICAgICAgICAgICAoanMvZG9jdW1lbnQuYm9keS5wcmVwZW5kKSkpKQoKKHNldCEgYXBwLmlubmVySFRNTCB5KQ%3D%3D

🎉 3
teodorlu 2024-06-27T10:57:48.881029Z

Huh, interesting that you made a deftype with a toString on it. I presume that was to allow nesting html in html, while also preventing raw html injection? I was wondering how you solved that. https://github.com/borkdude/html/blob/8635f7f0236e8dce2b1b693ccb14c52d793ed050/src/borkdude/html.cljc#L5 Congratulations on the release!

borkdude 2024-06-27T10:58:17.160709Z

yes

borkdude 2024-06-27T10:58:19.457479Z

and thanks

❤️ 1
Trevor 2024-06-27T22:02:44.198549Z

Excellent job! This works for me! I was having dynamic html problems and this solved the problem! Thank you very much

👍 1
borkdude 2024-06-27T22:05:36.882399Z

Please do let me know if you have any other problems :)

borkdude 2024-06-27T10:45:39.454049Z

Also, squint properly produces HTML5 now. If you were using the #html feature before, please test this new version since quite a few changes happened.