about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-04-06T18·32+0200
committerVincent Ambo <v.ambo@me.com>2012-04-06T18·32+0200
commitbb981085a6b7c11c479d7bc9ace6219ce8f8f311 (patch)
tree9ee72d5e5eba449acb6ceb986037463c575e8a91 /src
parentd1297a50b53317c381f7ff9a1146fe8a314ac0bc (diff)
* removed entryEscape -> Posting pure HTML from now on (pre tag where necessary)
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 656c9cfca7ef..c34725081623 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -181,8 +181,8 @@ postEntry acid = do
                     <*> getLang lang
                     <*> readCookieValue "sUser"
                     <*> lookText' "title"
-                    <*> pure (entryEscape nBtext)
-                    <*> pure (entryEscape nMtext)
+                    <*> pure nBtext
+                    <*> pure nMtext
                     <*> pure now
                     <*> pure [] -- NYI
                     <*> pure []
@@ -195,12 +195,6 @@ postEntry acid = do
     getLang "de" = return DE
     getLang "en" = return EN
 
-entryEscape :: Text -> Text
-entryEscape = newlineEscape . newlineRNEscape
-  where
-    newlineEscape = T.replace "\n" "<br>"
-    newlineRNEscape = T.replace "\r\n" "<br>"
-
 entryList :: AcidState Blog -> BlogLang -> ServerPart Response
 entryList acid lang = do
     entries <- query' acid (LatestEntries lang)
@@ -213,7 +207,7 @@ editEntry acid i = do
   where
     eId = EntryId i
 
-updateEntry :: AcidState Blog -> ServerPart Response
+updateEntry :: AcidState Blog -> ServerPart Response -- TODO: Clean this up
 updateEntry acid = do
     decodeBody tmpPolicy
     (eId :: Integer) <- lookRead "eid"
@@ -222,8 +216,8 @@ updateEntry acid = do
     nBtext <- lookText' "btext"
     nMtext <- lookText' "mtext"
     let nEntry = entry { title = nTitle
-                        , btext = entryEscape nBtext
-                        , mtext = entryEscape nMtext}
+                        , btext = nBtext
+                        , mtext = nMtext}
     update' acid (UpdateEntry nEntry)
     seeOther (concat $ intersperse' "/" [show $ lang entry, show eId])
              (toResponse ())