mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-20 20:12:04 +00:00
Update ListView.tsx
This commit is contained in:
parent
a3ca870fe5
commit
501f0f78c1
1 changed files with 26 additions and 6 deletions
|
|
@ -180,12 +180,32 @@ export function ListView({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-type-secondary mb-2 line-clamp-2 max-w-[12rem] md:max-w-[30rem] md:pr-8">
|
<div
|
||||||
{notification.description
|
className="text-sm text-type-secondary mb-2 line-clamp-2 max-w-[12rem] md:max-w-[30rem] md:pr-8"
|
||||||
.replace(/\n/g, " ")
|
// eslint-disable-next-line react/no-danger
|
||||||
.substring(0, 150)}
|
dangerouslySetInnerHTML={{
|
||||||
{notification.description.length > 150 ? "..." : ""}
|
__html:
|
||||||
</p>
|
notification.description
|
||||||
|
.replace(/\n\n/g, "</p><p>")
|
||||||
|
.replace(/\n- /g, "</p><p>• ")
|
||||||
|
.replace(
|
||||||
|
/\n\*\*([^*]+)\*\*/g,
|
||||||
|
"</p><h4>$1</h4><p>",
|
||||||
|
)
|
||||||
|
.replace(/^/, "<p>")
|
||||||
|
.replace(/$/, "</p>")
|
||||||
|
.replace(/<p><\/p>/g, "")
|
||||||
|
.replace(
|
||||||
|
/<p>• /g,
|
||||||
|
'<p class="flex items-start gap-2"><span class="text-type-link mt-1">•</span><span>',
|
||||||
|
)
|
||||||
|
.replace(/<\/p>/g, "</span></p>")
|
||||||
|
.substring(0, 150) +
|
||||||
|
(notification.description.length > 150
|
||||||
|
? "..."
|
||||||
|
: ""),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue