1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2026-01-06 03:17:05 +00:00

ui: Use web components to render server-side HTML

This commit is contained in:
James Hillyerd
2018-11-17 19:09:19 -08:00
parent f2cd3f92da
commit abd9ebeb35
5 changed files with 29 additions and 112 deletions

View File

@@ -60,9 +60,9 @@ update session msg model =
view : Session -> Model -> Html Msg
view session model =
div [ id "page" ]
[ div
[ Html.node "rendered-html"
[ class "greeting"
, property "innerHTML" (Encode.string model.greeting)
, property "content" (Encode.string model.greeting)
]
[]
]

View File

@@ -588,10 +588,10 @@ messageBody message bodyMode =
, article [ class "message-body" ]
[ case bodyMode of
SafeHtmlBody ->
div [ property "innerHTML" (Encode.string message.html) ] []
Html.node "rendered-html" [ property "content" (Encode.string message.html) ] []
TextBody ->
div [ property "innerHTML" (Encode.string message.text) ] []
Html.node "rendered-html" [ property "content" (Encode.string message.text) ] []
]
]