mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-23 16:34:28 -03:00
remplazo de hashtags
This commit is contained in:
@@ -44,6 +44,16 @@
|
|||||||
let cargandoLike = $state(false);
|
let cargandoLike = $state(false);
|
||||||
let errorLike = $state(false);
|
let errorLike = $state(false);
|
||||||
|
|
||||||
|
let contenido = $derived(() => {
|
||||||
|
let t = post.content.replaceAll('\n', '<br>');
|
||||||
|
t = t.replace(
|
||||||
|
/#\w*/gm,
|
||||||
|
(match) =>
|
||||||
|
`<a class="hover:text-blue-200 text-blue-400" href="/htag/${match.replace('#', '')}">${match}</a>`
|
||||||
|
);
|
||||||
|
return t;
|
||||||
|
});
|
||||||
|
|
||||||
async function handleBorrar() {
|
async function handleBorrar() {
|
||||||
await deletePost(
|
await deletePost(
|
||||||
post,
|
post,
|
||||||
@@ -127,7 +137,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<Content class="mx-5 -mt-4 rounded-lg bg-accent p-3">
|
<Content class="mx-5 -mt-4 rounded-lg bg-accent p-3">
|
||||||
<p class=" text-sm">{@html post.content.replaceAll('\n', '<br>')}</p>
|
<p class=" text-sm">{@html contenido()}</p>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
||||||
{#if post.imageUrl}
|
{#if post.imageUrl}
|
||||||
|
|||||||
Reference in New Issue
Block a user