From 46f116da60b46c93449ac5504d03cb48ba6a3aae Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Sun, 2 Jun 2019 14:59:47 +0000 Subject: [PATCH] In new comment form, turn CRLF into LF when running the form --- src/Vervis/Form/Discussion.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Vervis/Form/Discussion.hs b/src/Vervis/Form/Discussion.hs index 648acad..8dadcf8 100644 --- a/src/Vervis/Form/Discussion.hs +++ b/src/Vervis/Form/Discussion.hs @@ -1,6 +1,6 @@ {- This file is part of Vervis. - - - Written in 2016 by fr33domlover . + - Written in 2016, 2019 by fr33domlover . - - ♡ 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