Use pre-wrap on text changelogs/readmes #39

This commit is contained in:
Michael Snoyman 2014-11-24 10:32:13 +02:00
parent cdefe0bc3e
commit 4e945d5fd9
2 changed files with 11 additions and 2 deletions

View File

@ -38,6 +38,8 @@ import qualified Data.Version
import Text.ParserCombinators.ReadP (readP_to_S)
import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
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 =
@ -325,8 +327,10 @@ grabExtraFiles name version lfiles = runResourceT $ do
_ -> trip
_ -> trip
md = Just . toHtml . Markdown . decodeUtf8
txt = Just . toHtml . Textarea . toStrict . decodeUtf8
md = wrapClass "markdown" . Markdown . 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 s =

View File

@ -211,3 +211,8 @@ h2.changes-title {
border: none;
color: #fff;
}
/* https://github.com/fpco/stackage-server/issues/39 */
div.plain-text {
white-space: pre-wrap;
}