~ben/yesod-text-markdown

7d7e35b97d50360197a6139df8354d9926ede8a8 — Arash Rouhani 7 years ago bc07afc + 00c3fc0
Merge pull request #11 from MaxGabriel/documentMarkdownField

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