// SPDX-License-Identifier: GPL-2.0 // Adapted 2026-10-04 from Web3Templates Stablo cover-card composition. // Pinned source and full license: ../../../third_party/stablo/NOTICE.md and LICENSE. const escape=value=>String(value).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); /** Takes only validated preview records, never raw work metadata or filesystem paths. */ export function renderCards(works,lang) { if(!works.length) return `
${lang==='zh'?'当前预览暂无文章。':'No articles in this preview.'}
`; return `${escape(work.excerpt)}
`:''}