mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-28 14:23:04 +03:00
Update docs formatting.
This commit is contained in:
parent
4429341b68
commit
2116145386
@ -105,14 +105,19 @@ It's common to parse the body with a markdown parser or other format.
|
||||
}
|
||||
)
|
||||
(Decode.field "title" Decode.string)
|
||||
(markdownString |> markdownToView |> Decode.fromResult)
|
||||
(markdownString
|
||||
|> markdownToView
|
||||
|> Decode.fromResult
|
||||
)
|
||||
)
|
||||
|
||||
markdownToView : String -> Result String (List (Html msg))
|
||||
markdownToView :
|
||||
String
|
||||
-> Result String (List (Html msg))
|
||||
markdownToView markdownString =
|
||||
markdownString
|
||||
|> Markdown.Parser.parse
|
||||
|> Result.mapError (\_ -> "Markdown parsing error.")
|
||||
|> Result.mapError (\_ -> "Markdown error.")
|
||||
|> Result.andThen
|
||||
(\blocks ->
|
||||
Markdown.Renderer.render
|
||||
|
Loading…
Reference in New Issue
Block a user