From e5653bf29767c4240cf1762b18c774f5a244ee65 Mon Sep 17 00:00:00 2001 From: Evangelos Lamprou Date: Tue, 17 Oct 2023 16:26:22 +0200 Subject: [PATCH] Added stripping html tags from search result title In the future, we could keep certain tags like bold. For now, stripping is the most sane solution. --- frontend/elm.json | 2 ++ frontend/src/Main.elm | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/elm.json b/frontend/elm.json index b47b94d..325ea67 100644 --- a/frontend/elm.json +++ b/frontend/elm.json @@ -21,7 +21,9 @@ "elm/url": "1.0.0", "elm-community/list-extra": "8.7.0", "elm-community/maybe-extra": "5.3.0", + "elm-community/string-extra": "4.0.1", "figbus/elm-urbit-api": "4.0.1", + "hecrj/html-parser": "2.4.0", "ianmackenzie/elm-1d-parameter": "1.0.1", "ianmackenzie/elm-3d-camera": "3.1.0", "ianmackenzie/elm-3d-scene": "1.0.1", diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm index 632c0f1..17c7134 100644 --- a/frontend/src/Main.elm +++ b/frontend/src/Main.elm @@ -29,6 +29,8 @@ import Html.String import List import Css import Html.Styled.Attributes exposing (css) +import Html.Parser +import String.Extra exposing (stripTags) url : String @@ -256,10 +258,9 @@ view model = , Html.Attributes.style "padding" "0.5em" |> htmlAttribute , Html.Attributes.class "result" |> htmlAttribute ] - [ text title + [ text (stripTags title) |> el [ Font.size 16 - , width fill ] , text link |> el