Merge pull request #1412 from ncaq/master

fixed: yesod-form: textareaField: writeHtmlEscapedChar: convert "\r\n" to "<br>" closed #1354
This commit is contained in:
Michael Snoyman 2017-06-25 08:34:50 +03:00 committed by GitHub
commit 432c31a652
3 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,7 @@
## 1.4.13
* Fixed `textareaField` `writeHtmlEscapedChar` trim "\r"
## 1.4.12
* Password field does not remember its previous value

View File

@ -106,6 +106,10 @@ import Data.Attoparsec.Text (Parser, char, string, digit, skipSpace, endOfInput,
import Yesod.Persist.Core
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid
#endif
defaultFormMessage :: FormMessage -> Text
defaultFormMessage = englishFormMessage
@ -226,6 +230,7 @@ instance ToHtml Textarea where
. unTextarea
where
-- Taken from blaze-builder and modified with newline handling.
writeHtmlEscapedChar '\r' = mempty
writeHtmlEscapedChar '\n' = writeByteString "<br>"
writeHtmlEscapedChar c = B.writeHtmlEscapedChar c

View File

@ -1,5 +1,5 @@
name: yesod-form
version: 1.4.12
version: 1.4.13
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>