{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} module Commonmark.Extensions.HardLineBreaks ( hardLineBreaksSpec ) where import Commonmark.Types import Commonmark.Syntax import Commonmark.Inlines import Commonmark.TokParsers import Commonmark.Tokens hardLineBreaksSpec :: (Monad m, IsBlock il bl, IsInline il) => SyntaxSpec m il bl hardLineBreaksSpec :: forall (m :: * -> *) il bl. (Monad m, IsBlock il bl, IsInline il) => SyntaxSpec m il bl hardLineBreaksSpec = forall a. Monoid a => a mempty { syntaxInlineParsers :: [InlineParser m il] syntaxInlineParsers = [ forall (m :: * -> *) a. (Monad m, IsInline a) => InlineParser m a hardLineBreakParser ] } hardLineBreakParser :: (Monad m, IsInline a) => InlineParser m a hardLineBreakParser :: forall (m :: * -> *) a. (Monad m, IsInline a) => InlineParser m a hardLineBreakParser = forall a. IsInline a => a lineBreak forall (f :: * -> *) a b. Functor f => a -> f b -> f a <$ forall (m :: * -> *) s. Monad m => (Tok -> Bool) -> ParsecT [Tok] s m Tok satisfyTok (TokType -> Tok -> Bool hasType TokType LineEnd)