remove unsafe

This commit is contained in:
maddalax 2024-10-26 09:14:33 -05:00
parent 8e048cbddc
commit 3d4f3a9a77
3 changed files with 5 additions and 5 deletions

View file

@ -75,7 +75,7 @@ func Comment(item news.Comment, nesting int) *h.Element {
h.Class("flex gap-1 items-center"), h.Class("flex gap-1 items-center"),
h.Div( h.Div(
h.Class("font-bold text-rose-500"), h.Class("font-bold text-rose-500"),
h.UnsafeRaw(item.By), h.Text(item.By),
), ),
h.Div( h.Div(
h.Class("text-sm text-gray-600"), h.Class("text-sm text-gray-600"),
@ -85,7 +85,7 @@ func Comment(item news.Comment, nesting int) *h.Element {
), ),
h.Div( h.Div(
h.Class("text-sm text-gray-600"), h.Class("text-sm text-gray-600"),
h.UnsafeRaw(strings.TrimSpace(item.Text)), h.Text(strings.TrimSpace(item.Text)),
), ),
), ),
h.If( h.If(

View file

@ -142,7 +142,7 @@ var CachedStoryList = h.CachedPerKeyT4(time.Minute*5, func(category string, page
h.Class("block p-2 bg-white rounded-md shadow cursor-pointer"), h.Class("block p-2 bg-white rounded-md shadow cursor-pointer"),
h.Div( h.Div(
h.Class("font-bold"), h.Class("font-bold"),
h.UnsafeRaw(item.Title), h.Text(item.Title),
), ),
h.Div( h.Div(
h.Class("text-sm text-gray-600"), h.Class("text-sm text-gray-600"),

View file

@ -57,7 +57,7 @@ func StoryBody(story *news.Story) *h.Element {
h.Class("prose prose-2xl border-b border-gray-200 pb-3 max-w-none w-full"), h.Class("prose prose-2xl border-b border-gray-200 pb-3 max-w-none w-full"),
h.H5( h.H5(
h.Class("flex gap-2 items-left font-bold"), h.Class("flex gap-2 items-left font-bold"),
h.UnsafeRaw(story.Title), h.Text(story.Title),
), ),
h.A( h.A(
h.Href(story.Url), h.Href(story.Url),
@ -66,7 +66,7 @@ func StoryBody(story *news.Story) *h.Element {
), ),
h.Div( h.Div(
h.Class("text-sm text-gray-600"), h.Class("text-sm text-gray-600"),
h.UnsafeRaw(story.Text), h.Text(story.Text),
), ),
h.Div( h.Div(
h.Class("text-sm text-gray-600 mt-2"), h.Class("text-sm text-gray-600 mt-2"),