Deploy 8b14e9e from main
This commit is contained in:
@@ -98,10 +98,6 @@
|
||||
line-height: 1.65;
|
||||
color: #4b5563;
|
||||
margin: 0 0 0.625rem;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ── Author ────────────────────────────────────────────────────── */
|
||||
@@ -305,7 +301,6 @@
|
||||
|
||||
.pn-article-excerpt {
|
||||
font-size: 0.875rem;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.pn-pagination {
|
||||
|
||||
@@ -21,6 +21,19 @@ const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
||||
|
||||
/* ── Utilities ──────────────────────────────────────────────────────── */
|
||||
|
||||
/**
|
||||
* Decode HTML entities (e.g.,   ') to their plain-text equivalents.
|
||||
*
|
||||
* @param {string} str String potentially containing HTML entities.
|
||||
* @returns {string} Decoded string.
|
||||
*/
|
||||
function decodeEntities(str) {
|
||||
if (!str) return '';
|
||||
const txt = document.createElement('textarea');
|
||||
txt.innerHTML = str;
|
||||
return txt.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format an ISO date string to a human-readable form.
|
||||
*
|
||||
@@ -152,7 +165,7 @@ const Tag = memo(function Tag({
|
||||
const ArticleCard = memo(function ArticleCard({
|
||||
article
|
||||
}) {
|
||||
const summary = article.ai_summary || article.excerpt || '';
|
||||
const summary = decodeEntities(article.ai_summary || article.excerpt || '');
|
||||
const tagSource = article.tags || article.categories || '';
|
||||
const tags = tagSource ? tagSource.split(',').map(t => t.trim()).filter(Boolean).slice(0, 5) : [];
|
||||
const handleClick = useCallback(() => {
|
||||
@@ -179,7 +192,7 @@ const ArticleCard = memo(function ArticleCard({
|
||||
onClick: handleClick,
|
||||
target: "_blank",
|
||||
rel: "noopener noreferrer"
|
||||
}, article.title)), summary && /*#__PURE__*/React.createElement("p", {
|
||||
}, decodeEntities(article.title))), summary && /*#__PURE__*/React.createElement("p", {
|
||||
className: "pn-article-excerpt"
|
||||
}, summary), article.author && /*#__PURE__*/React.createElement("span", {
|
||||
className: "pn-author"
|
||||
|
||||
Reference in New Issue
Block a user