fix(application): render rich HTML product descriptions with responsive typography styling
This commit is contained in:
1 parent
bfb7f42065
commit
05e26cab9f
15 files changed
+7717
-7136
No files matched your search
@@ -437,7 +437,7 @@ export default function CatalogPageSpread({
|
||||
</p>
|
||||
)}
|
||||
<p className="text-[9px] text-slate-500 font-medium line-clamp-2 leading-relaxed text-justify">
|
||||
{product.shortDescription || product.description}
|
||||
{product.shortDescription || (product.description ? product.description.replace(/<[^>]*>/g, '') : '')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -75,9 +75,16 @@ export default function ProductDetailModal({ product, categoryColor = "#0284C7",
|
||||
<span className="text-xs font-black text-slate-400 uppercase tracking-widest block">
|
||||
شرح بالینی و عملکرد:
|
||||
</span>
|
||||
<p className="text-sm text-slate-600 leading-relaxed font-medium">
|
||||
{product.description}
|
||||
</p>
|
||||
{/<[a-z][\s\S]*>/i.test(product.description || '') ? (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: product.description || '' }}
|
||||
className="text-sm text-slate-600 leading-relaxed font-medium space-y-2 [&>h1]:font-black [&>h2]:font-black [&>h3]:font-black [&>p]:leading-relaxed [&>ul]:list-disc [&>ul]:pr-4 [&>ol]:list-decimal [&>ol]:pr-4 text-justify"
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-slate-600 leading-relaxed font-medium text-justify">
|
||||
{product.description}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Species & Dosage badges */}
|
||||
|
||||
Reference in new issue
Block a user