1

I an using Elm-UI and I would like add an Html <br> tag, but I am not sure how. \n doesn't seem to work.

Brock
  • 925
  • 5
  • 9

1 Answers1

2

For parsing a line breaks like \n from your input is already answered here.

Though because br [] [] is not part of Elm-Ui, and Elm-Ui does not have a similar attribute, the solution is to pipe the line break through Element.html.

For example:

import Element exposing (html, paragraph, text)
import Html exposing (br)

-- Snip

paragraph []
    [ text "first line"
    , html <| br [] []
    , text "second line"
    ]
Brock
  • 925
  • 5
  • 9