commonmark 0.2.6.1 → 0.3
raw patch · 7 files changed
+78/−4 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Commonmark.Types: instance (GHC.Base.Applicative f, Commonmark.Types.IsInline a, GHC.Base.Monoid (f a), GHC.Show.Show (f a)) => Commonmark.Types.IsInline (f a)
+ Commonmark.Types: instance (GHC.Base.Applicative f, GHC.Base.Monoid (f il), GHC.Show.Show (f il), GHC.Base.Monoid (f b), GHC.Show.Show (f b), Commonmark.Types.IsBlock il b) => Commonmark.Types.IsBlock (f il) (f b)
+ Commonmark.Types: instance (GHC.Base.Functor f, Commonmark.Types.HasAttributes a) => Commonmark.Types.HasAttributes (f a)
+ Commonmark.Types: instance (GHC.Base.Functor f, Commonmark.Types.Rangeable a) => Commonmark.Types.Rangeable (f a)
- Commonmark.Blocks: BPState :: !ReferenceMap -> (ReferenceMap -> [Tok] -> m (Either ParseError il)) -> [BlockNode m il bl] -> !Bool -> !Bool -> !Bool -> Map Text Dynamic -> Map Text SourcePos -> [ParsecT [Tok] (BPState m il bl) m Attributes] -> !Attributes -> BPState m il bl
+ Commonmark.Blocks: BPState :: !ReferenceMap -> (ReferenceMap -> [Tok] -> m (Either ParseError il)) -> [BlockNode m il bl] -> !Bool -> !Bool -> !Bool -> Map Text Dynamic -> Map Text SourcePos -> [ParsecT [Tok] (BPState m il bl) m Attributes] -> !Attributes -> BPState (m :: Type -> Type) il bl
- Commonmark.Blocks: BlockData :: BlockSpec m il bl -> [[Tok]] -> [SourcePos] -> !Dynamic -> [Int] -> !Attributes -> BlockData m il bl
+ Commonmark.Blocks: BlockData :: BlockSpec m il bl -> [[Tok]] -> [SourcePos] -> !Dynamic -> [Int] -> !Attributes -> BlockData (m :: Type -> Type) il bl
- Commonmark.Blocks: BlockSpec :: !Text -> BlockParser m il bl BlockStartResult -> (BlockSpec m il bl -> Bool) -> !Bool -> !Bool -> (BlockNode m il bl -> BlockParser m il bl (SourcePos, BlockNode m il bl)) -> (BlockNode m il bl -> BlockParser m il bl bl) -> (BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)) -> BlockSpec m il bl
+ Commonmark.Blocks: BlockSpec :: !Text -> BlockParser m il bl BlockStartResult -> (BlockSpec m il bl -> Bool) -> !Bool -> !Bool -> (BlockNode m il bl -> BlockParser m il bl (SourcePos, BlockNode m il bl)) -> (BlockNode m il bl -> BlockParser m il bl bl) -> (BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)) -> BlockSpec (m :: Type -> Type) il bl
- Commonmark.Blocks: [attributeParsers] :: BPState m il bl -> [ParsecT [Tok] (BPState m il bl) m Attributes]
+ Commonmark.Blocks: [attributeParsers] :: BPState (m :: Type -> Type) il bl -> [ParsecT [Tok] (BPState m il bl) m Attributes]
- Commonmark.Blocks: [blockAttributes] :: BlockData m il bl -> !Attributes
+ Commonmark.Blocks: [blockAttributes] :: BlockData (m :: Type -> Type) il bl -> !Attributes
- Commonmark.Blocks: [blockBlanks] :: BlockData m il bl -> [Int]
+ Commonmark.Blocks: [blockBlanks] :: BlockData (m :: Type -> Type) il bl -> [Int]
- Commonmark.Blocks: [blockCanContain] :: BlockSpec m il bl -> BlockSpec m il bl -> Bool
+ Commonmark.Blocks: [blockCanContain] :: BlockSpec (m :: Type -> Type) il bl -> BlockSpec m il bl -> Bool
- Commonmark.Blocks: [blockConstructor] :: BlockSpec m il bl -> BlockNode m il bl -> BlockParser m il bl bl
+ Commonmark.Blocks: [blockConstructor] :: BlockSpec (m :: Type -> Type) il bl -> BlockNode m il bl -> BlockParser m il bl bl
- Commonmark.Blocks: [blockContainsLines] :: BlockSpec m il bl -> !Bool
+ Commonmark.Blocks: [blockContainsLines] :: BlockSpec (m :: Type -> Type) il bl -> !Bool
- Commonmark.Blocks: [blockContinue] :: BlockSpec m il bl -> BlockNode m il bl -> BlockParser m il bl (SourcePos, BlockNode m il bl)
+ Commonmark.Blocks: [blockContinue] :: BlockSpec (m :: Type -> Type) il bl -> BlockNode m il bl -> BlockParser m il bl (SourcePos, BlockNode m il bl)
- Commonmark.Blocks: [blockData] :: BlockData m il bl -> !Dynamic
+ Commonmark.Blocks: [blockData] :: BlockData (m :: Type -> Type) il bl -> !Dynamic
- Commonmark.Blocks: [blockFinalize] :: BlockSpec m il bl -> BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)
+ Commonmark.Blocks: [blockFinalize] :: BlockSpec (m :: Type -> Type) il bl -> BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)
- Commonmark.Blocks: [blockLines] :: BlockData m il bl -> [[Tok]]
+ Commonmark.Blocks: [blockLines] :: BlockData (m :: Type -> Type) il bl -> [[Tok]]
- Commonmark.Blocks: [blockMatched] :: BPState m il bl -> !Bool
+ Commonmark.Blocks: [blockMatched] :: BPState (m :: Type -> Type) il bl -> !Bool
- Commonmark.Blocks: [blockParagraph] :: BlockSpec m il bl -> !Bool
+ Commonmark.Blocks: [blockParagraph] :: BlockSpec (m :: Type -> Type) il bl -> !Bool
- Commonmark.Blocks: [blockSpec] :: BlockData m il bl -> BlockSpec m il bl
+ Commonmark.Blocks: [blockSpec] :: BlockData (m :: Type -> Type) il bl -> BlockSpec m il bl
- Commonmark.Blocks: [blockStartPos] :: BlockData m il bl -> [SourcePos]
+ Commonmark.Blocks: [blockStartPos] :: BlockData (m :: Type -> Type) il bl -> [SourcePos]
- Commonmark.Blocks: [blockStart] :: BlockSpec m il bl -> BlockParser m il bl BlockStartResult
+ Commonmark.Blocks: [blockStart] :: BlockSpec (m :: Type -> Type) il bl -> BlockParser m il bl BlockStartResult
- Commonmark.Blocks: [blockType] :: BlockSpec m il bl -> !Text
+ Commonmark.Blocks: [blockType] :: BlockSpec (m :: Type -> Type) il bl -> !Text
- Commonmark.Blocks: [counters] :: BPState m il bl -> Map Text Dynamic
+ Commonmark.Blocks: [counters] :: BPState (m :: Type -> Type) il bl -> Map Text Dynamic
- Commonmark.Blocks: [failurePositions] :: BPState m il bl -> Map Text SourcePos
+ Commonmark.Blocks: [failurePositions] :: BPState (m :: Type -> Type) il bl -> Map Text SourcePos
- Commonmark.Blocks: [inlineParser] :: BPState m il bl -> ReferenceMap -> [Tok] -> m (Either ParseError il)
+ Commonmark.Blocks: [inlineParser] :: BPState (m :: Type -> Type) il bl -> ReferenceMap -> [Tok] -> m (Either ParseError il)
- Commonmark.Blocks: [maybeBlank] :: BPState m il bl -> !Bool
+ Commonmark.Blocks: [maybeBlank] :: BPState (m :: Type -> Type) il bl -> !Bool
- Commonmark.Blocks: [maybeLazy] :: BPState m il bl -> !Bool
+ Commonmark.Blocks: [maybeLazy] :: BPState (m :: Type -> Type) il bl -> !Bool
- Commonmark.Blocks: [nextAttributes] :: BPState m il bl -> !Attributes
+ Commonmark.Blocks: [nextAttributes] :: BPState (m :: Type -> Type) il bl -> !Attributes
- Commonmark.Blocks: [nodeStack] :: BPState m il bl -> [BlockNode m il bl]
+ Commonmark.Blocks: [nodeStack] :: BPState (m :: Type -> Type) il bl -> [BlockNode m il bl]
- Commonmark.Blocks: [referenceMap] :: BPState m il bl -> !ReferenceMap
+ Commonmark.Blocks: [referenceMap] :: BPState (m :: Type -> Type) il bl -> !ReferenceMap
- Commonmark.Blocks: addNodeToStack :: Monad m => BlockNode m bl il -> BlockParser m bl il ()
+ Commonmark.Blocks: addNodeToStack :: forall (m :: Type -> Type) bl il. Monad m => BlockNode m bl il -> BlockParser m bl il ()
- Commonmark.Blocks: attributeSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: attributeSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: atxHeadingSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: atxHeadingSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: blockQuoteSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: blockQuoteSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: bspec :: BlockNode m il bl -> BlockSpec m il bl
+ Commonmark.Blocks: bspec :: forall (m :: Type -> Type) il bl. BlockNode m il bl -> BlockSpec m il bl
- Commonmark.Blocks: bulletListMarker :: Monad m => BlockParser m il bl ListType
+ Commonmark.Blocks: bulletListMarker :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl ListType
- Commonmark.Blocks: collapseNodeStack :: [BlockNode m il bl] -> BlockParser m il bl (BlockNode m il bl)
+ Commonmark.Blocks: collapseNodeStack :: forall (m :: Type -> Type) il bl. [BlockNode m il bl] -> BlockParser m il bl (BlockNode m il bl)
- Commonmark.Blocks: data BPState m il bl
+ Commonmark.Blocks: data BPState (m :: Type -> Type) il bl
- Commonmark.Blocks: data BlockData m il bl
+ Commonmark.Blocks: data BlockData (m :: Type -> Type) il bl
- Commonmark.Blocks: data BlockSpec m il bl
+ Commonmark.Blocks: data BlockSpec (m :: Type -> Type) il bl
- Commonmark.Blocks: defBlockData :: BlockSpec m il bl -> BlockData m il bl
+ Commonmark.Blocks: defBlockData :: forall (m :: Type -> Type) il bl. BlockSpec m il bl -> BlockData m il bl
- Commonmark.Blocks: defaultBlockSpecs :: (Monad m, IsBlock il bl) => [BlockSpec m il bl]
+ Commonmark.Blocks: defaultBlockSpecs :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => [BlockSpec m il bl]
- Commonmark.Blocks: defaultFinalizer :: Monad m => BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)
+ Commonmark.Blocks: defaultFinalizer :: forall (m :: Type -> Type) il bl. Monad m => BlockNode m il bl -> BlockNode m il bl -> BlockParser m il bl (BlockNode m il bl)
- Commonmark.Blocks: docSpec :: (Monad m, IsBlock il bl, Monoid bl) => BlockSpec m il bl
+ Commonmark.Blocks: docSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl, Monoid bl) => BlockSpec m il bl
- Commonmark.Blocks: endOfBlock :: Monad m => BlockParser m il bl ()
+ Commonmark.Blocks: endOfBlock :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl ()
- Commonmark.Blocks: fencedCodeSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: fencedCodeSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: getBlockText :: BlockNode m il bl -> [Tok]
+ Commonmark.Blocks: getBlockText :: forall (m :: Type -> Type) il bl. BlockNode m il bl -> [Tok]
- Commonmark.Blocks: getParentListType :: Monad m => BlockParser m il bl (Maybe ListType)
+ Commonmark.Blocks: getParentListType :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl (Maybe ListType)
- Commonmark.Blocks: indentedCodeSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: indentedCodeSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: interruptsParagraph :: Monad m => BlockParser m bl il Bool
+ Commonmark.Blocks: interruptsParagraph :: forall (m :: Type -> Type) bl il. Monad m => BlockParser m bl il Bool
- Commonmark.Blocks: linkReferenceDef :: Monad m => ParsecT [Tok] s m Attributes -> ParsecT [Tok] s m ((SourceRange, Text), LinkInfo)
+ Commonmark.Blocks: linkReferenceDef :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Attributes -> ParsecT [Tok] s m ((SourceRange, Text), LinkInfo)
- Commonmark.Blocks: listItemSpec :: (Monad m, IsBlock il bl) => BlockParser m il bl ListType -> BlockSpec m il bl
+ Commonmark.Blocks: listItemSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockParser m il bl ListType -> BlockSpec m il bl
- Commonmark.Blocks: orderedListMarker :: Monad m => BlockParser m il bl ListType
+ Commonmark.Blocks: orderedListMarker :: forall (m :: Type -> Type) il bl. Monad m => BlockParser m il bl ListType
- Commonmark.Blocks: paraSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: paraSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: plainSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: plainSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: rawHtmlSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: rawHtmlSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: renderChildren :: (Monad m, IsBlock il bl) => BlockNode m il bl -> BlockParser m il bl [bl]
+ Commonmark.Blocks: renderChildren :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockNode m il bl -> BlockParser m il bl [bl]
- Commonmark.Blocks: runInlineParser :: Monad m => [Tok] -> BlockParser m il bl il
+ Commonmark.Blocks: runInlineParser :: forall (m :: Type -> Type) il bl. Monad m => [Tok] -> BlockParser m il bl il
- Commonmark.Blocks: setextHeadingSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: setextHeadingSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: thematicBreakSpec :: (Monad m, IsBlock il bl) => BlockSpec m il bl
+ Commonmark.Blocks: thematicBreakSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl) => BlockSpec m il bl
- Commonmark.Blocks: type BlockNode m il bl = Tree (BlockData m il bl)
+ Commonmark.Blocks: type BlockNode (m :: Type -> Type) il bl = Tree BlockData m il bl
- Commonmark.Blocks: type BlockParser m il bl = ParsecT [Tok] (BPState m il bl) m
+ Commonmark.Blocks: type BlockParser (m :: Type -> Type) il bl = ParsecT [Tok] BPState m il bl m
- Commonmark.Entity: charEntity :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Entity: charEntity :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Entity: numEntity :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Entity: numEntity :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Entity: pEntity :: Monad m => ParsecT [Tok] s m Tok
+ Commonmark.Entity: pEntity :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok
- Commonmark.Inlines: data IPState m
+ Commonmark.Inlines: data IPState (m :: Type -> Type)
- Commonmark.Inlines: defaultInlineParser :: (Monad m, IsInline a) => InlineParser m a
+ Commonmark.Inlines: defaultInlineParser :: forall (m :: Type -> Type) a. (Monad m, IsInline a) => InlineParser m a
- Commonmark.Inlines: getReferenceMap :: Monad m => InlineParser m ReferenceMap
+ Commonmark.Inlines: getReferenceMap :: forall (m :: Type -> Type). Monad m => InlineParser m ReferenceMap
- Commonmark.Inlines: pBacktickSpan :: Monad m => Tok -> InlineParser m (Either [Tok] [Tok])
+ Commonmark.Inlines: pBacktickSpan :: forall (m :: Type -> Type). Monad m => Tok -> InlineParser m (Either [Tok] [Tok])
- Commonmark.Inlines: pEscaped :: Monad m => ParsecT [Tok] s m Tok
+ Commonmark.Inlines: pEscaped :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok
- Commonmark.Inlines: pEscapedSymbol :: Monad m => ParsecT [Tok] s m Tok
+ Commonmark.Inlines: pEscapedSymbol :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok
- Commonmark.Inlines: pLinkDestination :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Inlines: pLinkDestination :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Inlines: pLinkLabel :: Monad m => ParsecT [Tok] s m Text
+ Commonmark.Inlines: pLinkLabel :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Text
- Commonmark.Inlines: pLinkTitle :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Inlines: pLinkTitle :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Inlines: type InlineParser m = ParsecT [Tok] (IPState m) (StateT Enders m)
+ Commonmark.Inlines: type InlineParser (m :: Type -> Type) = ParsecT [Tok] IPState m StateT Enders m
- Commonmark.Inlines: withAttributes :: (IsInline a, Monad m) => InlineParser m a -> InlineParser m a
+ Commonmark.Inlines: withAttributes :: forall a (m :: Type -> Type). (IsInline a, Monad m) => InlineParser m a -> InlineParser m a
- Commonmark.Parser: data () => ParseError
+ Commonmark.Parser: data ParseError
- Commonmark.Syntax: SyntaxSpec :: [BlockSpec m il bl] -> [BracketedSpec il] -> [FormattingSpec il] -> [InlineParser m il] -> [BlockParser m il bl bl] -> (forall u m1. Monad m1 => [ParsecT [Tok] u m1 Attributes]) -> SyntaxSpec m il bl
+ Commonmark.Syntax: SyntaxSpec :: [BlockSpec m il bl] -> [BracketedSpec il] -> [FormattingSpec il] -> [InlineParser m il] -> [BlockParser m il bl bl] -> (forall u (m1 :: Type -> Type). Monad m1 => [ParsecT [Tok] u m1 Attributes]) -> SyntaxSpec (m :: Type -> Type) il bl
- Commonmark.Syntax: [syntaxAttributeParsers] :: SyntaxSpec m il bl -> forall u m1. Monad m1 => [ParsecT [Tok] u m1 Attributes]
+ Commonmark.Syntax: [syntaxAttributeParsers] :: SyntaxSpec (m :: Type -> Type) il bl -> forall u (m1 :: Type -> Type). Monad m1 => [ParsecT [Tok] u m1 Attributes]
- Commonmark.Syntax: [syntaxBlockSpecs] :: SyntaxSpec m il bl -> [BlockSpec m il bl]
+ Commonmark.Syntax: [syntaxBlockSpecs] :: SyntaxSpec (m :: Type -> Type) il bl -> [BlockSpec m il bl]
- Commonmark.Syntax: [syntaxBracketedSpecs] :: SyntaxSpec m il bl -> [BracketedSpec il]
+ Commonmark.Syntax: [syntaxBracketedSpecs] :: SyntaxSpec (m :: Type -> Type) il bl -> [BracketedSpec il]
- Commonmark.Syntax: [syntaxFinalParsers] :: SyntaxSpec m il bl -> [BlockParser m il bl bl]
+ Commonmark.Syntax: [syntaxFinalParsers] :: SyntaxSpec (m :: Type -> Type) il bl -> [BlockParser m il bl bl]
- Commonmark.Syntax: [syntaxFormattingSpecs] :: SyntaxSpec m il bl -> [FormattingSpec il]
+ Commonmark.Syntax: [syntaxFormattingSpecs] :: SyntaxSpec (m :: Type -> Type) il bl -> [FormattingSpec il]
- Commonmark.Syntax: [syntaxInlineParsers] :: SyntaxSpec m il bl -> [InlineParser m il]
+ Commonmark.Syntax: [syntaxInlineParsers] :: SyntaxSpec (m :: Type -> Type) il bl -> [InlineParser m il]
- Commonmark.Syntax: data SyntaxSpec m il bl
+ Commonmark.Syntax: data SyntaxSpec (m :: Type -> Type) il bl
- Commonmark.Syntax: defaultSyntaxSpec :: (Monad m, IsBlock il bl, IsInline il) => SyntaxSpec m il bl
+ Commonmark.Syntax: defaultSyntaxSpec :: forall (m :: Type -> Type) il bl. (Monad m, IsBlock il bl, IsInline il) => SyntaxSpec m il bl
- Commonmark.Tag: htmlAttributeName :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Tag: htmlAttributeName :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Tag: htmlAttributeValue :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Tag: htmlAttributeValue :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Tag: htmlClosingTag :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Tag: htmlClosingTag :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Tag: htmlDoubleQuotedAttributeValue :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Tag: htmlDoubleQuotedAttributeValue :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Tag: htmlOpenTag :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.Tag: htmlOpenTag :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.Tag: htmlTag :: Monad m => ParsecT [Tok] s (StateT Enders m) [Tok]
+ Commonmark.Tag: htmlTag :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s (StateT Enders m) [Tok]
- Commonmark.TokParsers: anySymbol :: Monad m => ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: anySymbol :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok
- Commonmark.TokParsers: anyTok :: Monad m => ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: anyTok :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok
- Commonmark.TokParsers: blankLine :: Monad m => ParsecT [Tok] s m ()
+ Commonmark.TokParsers: blankLine :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m ()
- Commonmark.TokParsers: gobbleSpaces :: Monad m => Int -> ParsecT [Tok] u m Int
+ Commonmark.TokParsers: gobbleSpaces :: forall (m :: Type -> Type) u. Monad m => Int -> ParsecT [Tok] u m Int
- Commonmark.TokParsers: gobbleUpToSpaces :: Monad m => Int -> ParsecT [Tok] u m Int
+ Commonmark.TokParsers: gobbleUpToSpaces :: forall (m :: Type -> Type) u. Monad m => Int -> ParsecT [Tok] u m Int
- Commonmark.TokParsers: lineEnd :: Monad m => ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: lineEnd :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok
- Commonmark.TokParsers: noneOfToks :: Monad m => [TokType] -> ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: noneOfToks :: forall (m :: Type -> Type) s. Monad m => [TokType] -> ParsecT [Tok] s m Tok
- Commonmark.TokParsers: nonindentSpaces :: Monad m => ParsecT [Tok] u m ()
+ Commonmark.TokParsers: nonindentSpaces :: forall (m :: Type -> Type) u. Monad m => ParsecT [Tok] u m ()
- Commonmark.TokParsers: oneOfToks :: Monad m => [TokType] -> ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: oneOfToks :: forall (m :: Type -> Type) s. Monad m => [TokType] -> ParsecT [Tok] s m Tok
- Commonmark.TokParsers: restOfLine :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.TokParsers: restOfLine :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.TokParsers: satisfyTok :: Monad m => (Tok -> Bool) -> ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: satisfyTok :: forall (m :: Type -> Type) s. Monad m => (Tok -> Bool) -> ParsecT [Tok] s m Tok
- Commonmark.TokParsers: satisfyWord :: Monad m => (Text -> Bool) -> ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: satisfyWord :: forall (m :: Type -> Type) s. Monad m => (Text -> Bool) -> ParsecT [Tok] s m Tok
- Commonmark.TokParsers: skipManyTill :: ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m ()
+ Commonmark.TokParsers: skipManyTill :: forall s u (m :: Type -> Type) a b. ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m ()
- Commonmark.TokParsers: skipWhile :: Monad m => (Tok -> Bool) -> ParsecT [Tok] u m ()
+ Commonmark.TokParsers: skipWhile :: forall (m :: Type -> Type) u. Monad m => (Tok -> Bool) -> ParsecT [Tok] u m ()
- Commonmark.TokParsers: spaceTok :: Monad m => ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: spaceTok :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m Tok
- Commonmark.TokParsers: symbol :: Monad m => Char -> ParsecT [Tok] s m Tok
+ Commonmark.TokParsers: symbol :: forall (m :: Type -> Type) s. Monad m => Char -> ParsecT [Tok] s m Tok
- Commonmark.TokParsers: whitespace :: Monad m => ParsecT [Tok] s m [Tok]
+ Commonmark.TokParsers: whitespace :: forall (m :: Type -> Type) s. Monad m => ParsecT [Tok] s m [Tok]
- Commonmark.TokParsers: withRaw :: Monad m => ParsecT [Tok] s m a -> ParsecT [Tok] s m (a, [Tok])
+ Commonmark.TokParsers: withRaw :: forall (m :: Type -> Type) s a. Monad m => ParsecT [Tok] s m a -> ParsecT [Tok] s m (a, [Tok])
- Commonmark.Tokens: data () => SourcePos
+ Commonmark.Tokens: data SourcePos
- Commonmark.Types: data () => SourcePos
+ Commonmark.Types: data SourcePos
Files
- changelog.md +12/−0
- commonmark.cabal +2/−2
- src/Commonmark/Html.hs +1/−0
- src/Commonmark/Inlines.hs +5/−2
- src/Commonmark/SourceMap.hs +1/−0
- src/Commonmark/Types.hs +32/−0
- test/regression.md +25/−0
changelog.md view
@@ -1,5 +1,17 @@ # Changelog for commonmark +## 0.3++ * Applicative instances of IsBlock, IsInline etc. (Ashley Yakeley).+ [API change]++ * Require separation between title quotes and URL (Michael Howell).+ This commit brings commonmark-hs into alignment with commonmark.js.++ * Don't warn about deriving typeable.++ * Add CPP to avoid warning for ghc >= 9.10.+ ## 0.2.6.1 * Fix parsing of link destinations that look like `code` or
commonmark.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: commonmark-version: 0.2.6.1+version: 0.3 synopsis: Pure Haskell commonmark parser. description: This library provides the core data types and functions@@ -80,7 +80,7 @@ ghc-options: -Wunused-packages if impl(ghc >= 8.8) ghc-options: -fwrite-ide-info -hiedir=.hie- ghc-options: -Wall -fno-warn-unused-do-bind -funbox-small-strict-fields+ ghc-options: -Wall -fno-warn-deriving-typeable -fno-warn-unused-do-bind -funbox-small-strict-fields default-language: Haskell2010 other-extensions: StrictData
src/Commonmark/Html.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE MonoLocalBinds #-} module Commonmark.Html ( Html , htmlInline
src/Commonmark/Inlines.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE BangPatterns #-}@@ -50,7 +51,10 @@ import Commonmark.Types import Control.Monad (guard, mzero, mplus) import Control.Monad.Trans.State.Strict+#if MIN_VERSION_base(4,20,0)+#else import Data.List (foldl')+#endif import Unicode.Char (isAscii, isAlpha) import qualified Data.IntMap.Strict as IntMap import qualified Data.Map.Strict as M@@ -941,9 +945,8 @@ _ <- symbol '(' optional whitespace target <- untokenize <$> pLinkDestination+ title <- option "" $ unEntity <$> (whitespace *> pLinkTitle) optional whitespace- title <- option "" $- unEntity <$> (pLinkTitle <* optional whitespace) _ <- symbol ')' return $! LinkInfo { linkDestination = target , linkTitle = title
src/Commonmark/SourceMap.hs view
@@ -5,6 +5,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MonoLocalBinds #-} module Commonmark.SourceMap ( SourceMap(..) , WithSourceMap(..)
src/Commonmark/Types.hs view
@@ -2,6 +2,8 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE MonoLocalBinds #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE UndecidableInstances #-} module Commonmark.Types ( Format(..)@@ -79,6 +81,19 @@ code :: Text -> a rawInline :: Format -> Text -> a +instance {-# OVERLAPPABLE #-} (Applicative f, IsInline a, Monoid (f a), Show (f a)) => IsInline (f a) where+ lineBreak = pure lineBreak+ softBreak = pure softBreak+ str t = pure $ str t+ entity t = pure $ entity t+ escapedChar c = pure $ escapedChar c+ emph = fmap emph+ strong = fmap strong+ link d t = fmap $ link d t+ image s t = fmap $ image s t+ code t = pure $ code t+ rawInline f t = pure $ rawInline f t+ class (Monoid b, Show b, Rangeable b, IsInline il, HasAttributes b) => IsBlock il b | b -> il where paragraph :: il -> b@@ -95,6 +110,17 @@ -> b list :: ListType -> ListSpacing -> [b] -> b +instance {-# OVERLAPPABLE #-} (Applicative f, Monoid (f il), Show (f il), Monoid (f b), Show (f b), IsBlock il b) => IsBlock (f il) (f b) where+ paragraph = fmap paragraph+ plain = fmap plain+ thematicBreak = pure thematicBreak+ blockQuote = fmap blockQuote+ codeBlock p q = pure $ codeBlock p q+ heading l = fmap $ heading l+ rawBlock f t = pure $ rawBlock f t+ referenceLinkDefinition l dt = pure $ referenceLinkDefinition l dt+ list lt ls fbs = fmap (list lt ls) $ sequenceA fbs+ newtype SourceRange = SourceRange { unSourceRange :: [(SourcePos, SourcePos)] } deriving (Eq, Ord, Data, Typeable)@@ -122,6 +148,9 @@ class Rangeable a where ranged :: SourceRange -> a -> a +instance {-# OVERLAPPABLE #-} (Functor f, Rangeable a) => Rangeable (f a) where+ ranged sr = fmap $ ranged sr+ prettyRange :: SourceRange -> String prettyRange (SourceRange xs) = go "" xs where@@ -147,6 +176,9 @@ class HasAttributes a where addAttributes :: Attributes -> a -> a++instance {-# OVERLAPPABLE #-} (Functor f, HasAttributes a) => HasAttributes (f a) where+ addAttributes attrs = fmap $ addAttributes attrs class ToPlainText a where toPlainText :: a -> Text
test/regression.md view
@@ -482,3 +482,28 @@ . <p><a href="%60">x</a> <a href="`"></p> ````````````````````````````````++https://github.com/pulldown-cmark/pulldown-cmark/issues/1099++Link must be separated from title by at least one space++```````````````````````````````` example+[a](https://example.com"test")+[a](<https://example.com>"test")+[a](https://example.com(test))+[a](<https://example.com>(test))++[a](https://example.com "test")+[a](<https://example.com> "test")+[a](https://example.com (test))+[a](<https://example.com> (test))+.+<p><a href="https://example.com%22test%22">a</a>+[a](<a href="https://example.com">https://example.com</a>"test")+<a href="https://example.com(test)">a</a>+[a](<a href="https://example.com">https://example.com</a>(test))</p>+<p><a href="https://example.com" title="test">a</a>+<a href="https://example.com" title="test">a</a>+<a href="https://example.com" title="test">a</a>+<a href="https://example.com" title="test">a</a></p>+````````````````````````````````