move sanitization code out of api package

This commit is contained in:
orangix
2026-01-25 06:25:21 +01:00
parent 02be603dcc
commit e241d35efe
7 changed files with 63 additions and 56 deletions

View File

@@ -11,7 +11,7 @@
{{/equal}}
</div>
<div>
<p>{{{this.Comment}}}</p>
<p>{{{sanitizeComment(this.Comment)}}}</p>
<div class="flex gap-2">
<span title="{{this.CreatedAt}}">{{relTime(this.CreatedAt)}}</span>
{{#ifNonZeroTime this.DeletedAt}}

View File

@@ -3,7 +3,7 @@
<img class="object-cover block w-full h-[300px] sm:w-[120px] sm:h-[140px] rounded-lg rounded-b-none sm:rounded-b-lg" src="{{this.Post.Cover.Url}}" alt="">
<div class="flex flex-col gap-2 bg-slate-600 p-4 rounded-lg rounded-t-none sm:rounded-t-lg w-full">
<div class="flex flex-col h-full">
<p class="md-container">{{{this.Comment}}}</p>
<p class="md-container">{{{sanitizeComment(this.Comment)}}}</p>
<div class="grow"></div>
<div class="flex gap-2">
<span title="{{this.CreatedAt}}">{{relTime(this.CreatedAt)}}</span>

View File

@@ -75,7 +75,7 @@
{{/equal}}
{{#if this.Description}}
<p>{{{this.Description}}}</p>
<p>{{{sanitizeDescription(this.Description)}}}</p>
{{/if}}
{{/each}}
</div>