commonmark
Safe HaskellNone
LanguageHaskell2010

Commonmark.Inlines

Synopsis

Documentation

defaultInlineParser :: forall (m :: Type -> Type) a. (Monad m, IsInline a) => InlineParser m a Source #

data IPState (m :: Type -> Type) Source #

type InlineParser (m :: Type -> Type) = ParsecT [Tok] (IPState m) (StateT Enders m) Source #

Specifies delimiters for formatting, e.g. strong emphasis.

data FormattingSpec il Source #

Constructors

FormattingSpec 

Fields

Instances

Instances details
Show (FormattingSpec il) Source # 
Instance details

Defined in Commonmark.Inlines

data BracketedSpec il Source #

Constructors

BracketedSpec 

Fields

Instances

Instances details
Show (BracketedSpec il) Source # 
Instance details

Defined in Commonmark.Inlines

data LinkInfo Source #

Constructors

LinkInfo 

Fields

Instances

Instances details
Show LinkInfo Source # 
Instance details

Defined in Commonmark.ReferenceMap

pLinkLabel :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Text Source #

pLinkDestination :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok] Source #

pLinkTitle :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok] Source #

pEscaped :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok Source #

pEscapedSymbol :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok Source #

processEmphasis :: IsInline a => [Chunk a] -> [Chunk a] Source #

processBrackets :: IsInline a => [BracketedSpec a] -> ReferenceMap -> [Chunk a] -> Map Text SourcePos -> Either (DState a) [Chunk a] Source #

Process square brackets: links, images, and the span extension.

DState tracks the current position and backtracking limits.

If this function succeeds, returning Right, it will return a list of chunks, now annotated with bracket information.

If this function fails, it will return `Left DState`. This can happen if a chunk straddles a link destination, like this

link text looks like code` ^-----------------^

To recover, the caller must re-Chunk everything after the end paren. The bottoms parameter, in particular, is DState's stackBottoms, and is used to prevent things before the paren from being re-parsed.

pBacktickSpan :: forall (m :: Type -> Type). Monad m => Tok -> InlineParser m (Either [Tok] [Tok]) Source #

withAttributes :: forall a (m :: Type -> Type). (IsInline a, Monad m) => InlineParser m a -> InlineParser m a Source #