Parse and render code tag correctly in body
This commit is contained in:
parent
fc2742d890
commit
5022b8c3da
|
@ -1 +1 @@
|
||||||
Subproject commit 491616d096e0ded61bd341487f2487d9082d9b5c
|
Subproject commit c1b581c8d13f87d2c4694933a6fcc6b30c37ccb7
|
|
@ -14,15 +14,11 @@ import System.FilePath ((</>))
|
||||||
import Data.Time.Clock (UTCTime, getCurrentTime)
|
import Data.Time.Clock (UTCTime, getCurrentTime)
|
||||||
import Control.Concurrent.MVar (MVar, newEmptyMVar)
|
import Control.Concurrent.MVar (MVar, newEmptyMVar)
|
||||||
|
|
||||||
import Data.Aeson (FromJSON)
|
|
||||||
import Data.JSString (pack, append, unpack)
|
import Data.JSString (pack, append, unpack)
|
||||||
import Miso
|
import Miso
|
||||||
( View
|
( View
|
||||||
, startApp
|
, startApp
|
||||||
, App (..)
|
, App (..)
|
||||||
, h1_
|
|
||||||
, div_
|
|
||||||
, text
|
|
||||||
, Effect
|
, Effect
|
||||||
, (<#)
|
, (<#)
|
||||||
, noEff
|
, noEff
|
||||||
|
@ -34,8 +30,6 @@ import Miso
|
||||||
, consoleLog
|
, consoleLog
|
||||||
, pushURI
|
, pushURI
|
||||||
, uriSub
|
, uriSub
|
||||||
, time_
|
|
||||||
, class_
|
|
||||||
)
|
)
|
||||||
import GHCJS.DOM (currentDocument)
|
import GHCJS.DOM (currentDocument)
|
||||||
import GHCJS.DOM.Types (toJSString, fromJSString, Element, JSString)
|
import GHCJS.DOM.Types (toJSString, fromJSString, Element, JSString)
|
||||||
|
@ -46,8 +40,6 @@ import Servant.API
|
||||||
import Common.FrontEnd.Action
|
import Common.FrontEnd.Action
|
||||||
import Common.FrontEnd.Routes
|
import Common.FrontEnd.Routes
|
||||||
import qualified Network.Client as Client
|
import qualified Network.Client as Client
|
||||||
import Common.Network.CatalogPostType (CatalogPost)
|
|
||||||
import qualified Common.Network.CatalogPostType as CatalogPost
|
|
||||||
import qualified Common.Component.CatalogGrid as Grid
|
import qualified Common.Component.CatalogGrid as Grid
|
||||||
import qualified Common.Component.ThreadView as Thread
|
import qualified Common.Component.ThreadView as Thread
|
||||||
import qualified Common.Component.TimeControl as TC
|
import qualified Common.Component.TimeControl as TC
|
||||||
|
|
|
@ -76,6 +76,7 @@ toPostPart_ node_type node
|
||||||
"STRONG" -> parseStrong element
|
"STRONG" -> parseStrong element
|
||||||
"U" -> parseU element
|
"U" -> parseU element
|
||||||
"S" -> parseS element
|
"S" -> parseS element
|
||||||
|
"PRE" -> parseCode element
|
||||||
"BR" -> return Skip
|
"BR" -> return Skip
|
||||||
_ -> do
|
_ -> do
|
||||||
consoleLog tagName
|
consoleLog tagName
|
||||||
|
@ -142,3 +143,8 @@ parseS :: Element -> IO PostPart
|
||||||
parseS element
|
parseS element
|
||||||
= parseChildNodes element
|
= parseChildNodes element
|
||||||
>>= return . Strikethrough
|
>>= return . Strikethrough
|
||||||
|
|
||||||
|
parseCode :: Element -> IO PostPart
|
||||||
|
parseCode element
|
||||||
|
= parseChildNodes element
|
||||||
|
>>= return . Code
|
||||||
|
|
Loading…
Reference in New Issue