mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 11:14:51 +09:00
In new comment form, turn CRLF into LF when running the form
This commit is contained in:
parent
c7dccbb7fe
commit
46f116da60
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue