mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-20 16:01:55 +01:00
Use pre-wrap on text changelogs/readmes #39
This commit is contained in:
parent
cdefe0bc3e
commit
4e945d5fd9
@ -38,6 +38,8 @@ import qualified Data.Version
|
|||||||
import Text.ParserCombinators.ReadP (readP_to_S)
|
import Text.ParserCombinators.ReadP (readP_to_S)
|
||||||
import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
|
import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
|
||||||
import Text.Blaze.Html (unsafeByteString)
|
import Text.Blaze.Html (unsafeByteString)
|
||||||
|
import qualified Text.Blaze.Html5 as H
|
||||||
|
import qualified Text.Blaze.Html5.Attributes as A
|
||||||
|
|
||||||
sinkUploadHistory :: Monad m => Consumer (Entity Uploaded) m UploadHistory
|
sinkUploadHistory :: Monad m => Consumer (Entity Uploaded) m UploadHistory
|
||||||
sinkUploadHistory =
|
sinkUploadHistory =
|
||||||
@ -325,8 +327,10 @@ grabExtraFiles name version lfiles = runResourceT $ do
|
|||||||
_ -> trip
|
_ -> trip
|
||||||
_ -> trip
|
_ -> trip
|
||||||
|
|
||||||
md = Just . toHtml . Markdown . decodeUtf8
|
md = wrapClass "markdown" . Markdown . decodeUtf8
|
||||||
txt = Just . toHtml . Textarea . toStrict . decodeUtf8
|
txt = wrapClass "plain-text" . Textarea . toStrict . decodeUtf8
|
||||||
|
|
||||||
|
wrapClass clazz inner = Just $ H.div H.! A.class_ clazz $ toHtml inner
|
||||||
|
|
||||||
parseFilePath :: String -> Maybe (PackageName, Version)
|
parseFilePath :: String -> Maybe (PackageName, Version)
|
||||||
parseFilePath s =
|
parseFilePath s =
|
||||||
|
|||||||
@ -211,3 +211,8 @@ h2.changes-title {
|
|||||||
border: none;
|
border: none;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* https://github.com/fpco/stackage-server/issues/39 */
|
||||||
|
div.plain-text {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user