In new comment form, turn CRLF into LF when running the form

This commit is contained in:
fr33domlover 2019-06-02 14:59:47 +00:00
parent c7dccbb7fe
commit 46f116da60

View file

@ -1,6 +1,6 @@
{- This file is part of Vervis.
-
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
- Written in 2016, 2019 by fr33domlover <fr33domlover@riseup.net>.
-
- Copying is an act of love. Please copy, reuse and share.
-
@ -24,6 +24,8 @@ import Prelude
import Data.Text (Text)
import Yesod.Form
import qualified Data.Text as T
import Vervis.Foundation (Form, Handler)
import Vervis.Model
@ -33,7 +35,7 @@ data NewMessage = NewMessage
newMessageAForm :: AForm Handler NewMessage
newMessageAForm = NewMessage
<$> (unTextarea <$> areq textareaField "" Nothing)
<$> (T.filter (/= '\r') . unTextarea <$> areq textareaField "" Nothing)
newMessageForm :: Form NewMessage
newMessageForm = renderDivs newMessageAForm