From 155c9c5bbb703490e5d61f7b4504987e35088a95 Mon Sep 17 00:00:00 2001 From: unwox Date: Wed, 11 Dec 2024 20:41:29 +0600 Subject: integrate moychay.ru tea shop --- bin/serve.fnl | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'bin/serve.fnl') diff --git a/bin/serve.fnl b/bin/serve.fnl index 5cfc535..9329bf1 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -5,6 +5,7 @@ (local math (require :math)) (local fennel (require :vendor.fennel)) (local html (require :vendor.html)) +(local libhtml (require :lib.html)) (local json (require :vendor.json)) (local array (require :lib.array)) (local str (require :lib.string)) @@ -57,15 +58,6 @@ "термос" "бутылка" "бутылка" "термос"}) -(fn unescape [s] - (assert (= (type s) :string) "s must be string") - (pick-values 1 - (-> s - (string.gsub "<" "<") - (string.gsub ">" ">") - (string.gsub """ "\"") - (string.gsub "&" "&")))) - (fn sanitize-input [input] (if input (str.trim (input:gsub "[=()<>']" "") " ") @@ -333,7 +325,9 @@ :alt product.title} ""]] (site-name-template product.site) [:a {:href link :style "text-decoration: none;" :rel "nofollow"} - [:NO-ESCAPE (.. "
" (unescape product.title) "
")]] + [:NO-ESCAPE (.. "
" + (libhtml.unescape product.title) + "
")]] [:div {:class "price"} (if product.price (.. (str.format-price product.price) "₽") "") (if (< 0 product.weight) @@ -447,7 +441,7 @@ [:option {:value val :selected (if (= form.site val) "selected" nil)} (. (require (.. "parser." val)) :title)]) - [:ozchai :clubcha :ipuer :artoftea :chaekshop]))]] + [:ozchai :clubcha :ipuer :artoftea :chaekshop :moychay]))]] [:div {} [:select {:name "sort"} [:option {:value ""} "~ Порядок ~"] -- cgit v1.2.3