~ben/yesod-text-markdown

00c3fc0de3a5cc9a87f92952738844fd0a81ce5f — Maximilian Tagher 7 years ago bc07afc
Document markdownField
1 files changed, 1 insertions(+), 0 deletions(-)

M Yesod/Text/Markdown.hs
M Yesod/Text/Markdown.hs => Yesod/Text/Markdown.hs +1 -0
@@ 34,6 34,7 @@ instance FromJSON Markdown where
  parseJSON (Object v) = Markdown <$> v .: "markdown"
  parseJSON _ = mzero

-- | Creates a @\<textarea>@ tag whose returned value is wrapped in a 'Markdown' newtype; see 'Markdown' for details.
markdownField :: (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Markdown
markdownField = Field
    { fieldParse = parseHelper $ Right . Markdown . fromStrict