// Product-owned text is escaped; imported HTML is never executed. const esc = (value) => String(value ?? "") .replaceAll("&", "&") .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll('"', """); /** Support note appended after every product description (links are trusted site URLs). */ function descriptionHelpHtml() { return `
در صورت نیاز به اطلاعات بیشتر راجع به این محصول میتوانید به پشتیبانی کیکومیکو پیام دهید یا به وبسایت اصلی کیکو مراجعه فرمایید.
`; } function descriptionHtml(description) { if (!description) return ""; const [intro, ...rest] = String(description).split(/\n\s*\n/); return `${esc(intro)}${ rest.length ? `\n\n${esc(rest.join("\n\n"))}` : "" }
${descriptionHelpHtml()}`; } export function detailRows() { // Detail / facts tables are intentionally unused on the storefront. return []; } export function renderProductContent(container, product, variant = {}) { const description = variant.description || variant.descriptionIntro || product.description || product.descriptionIntro || ""; if (container) { const descBlock = description ? `