{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Text.Pandoc.Readers.CommonMark (readCommonMark)
where
import Commonmark
import Commonmark.Extensions
import Commonmark.Pandoc
import Data.Text (Text)
import Text.Pandoc.Class.PandocMonad (PandocMonad)
import Text.Pandoc.Definition
import Text.Pandoc.Builder as B
import Text.Pandoc.Options
import Text.Pandoc.Readers.Metadata (yamlMetaBlock)
import Control.Monad (MonadPlus(mzero))
import Control.Monad.Except ( MonadError(throwError) )
import Data.Functor.Identity (runIdentity)
import Data.Typeable
import Text.Pandoc.Parsing (runParserT, getInput, getPosition,
runF, defaultParserState, option, many1, anyChar,
Sources(..), ToSources(..), ParsecT, Future,
incSourceLine, fromParsecError)
import Text.Pandoc.Walk (walk)
import qualified Data.Text as T
import qualified Data.Attoparsec.Text as A
import Control.Applicative ((<|>))
readCommonMark :: (PandocMonad m, ToSources a)
=> ReaderOptions -> a -> m Pandoc
readCommonMark :: forall (m :: * -> *) a.
(PandocMonad m, ToSources a) =>
ReaderOptions -> a -> m Pandoc
readCommonMark ReaderOptions
opts a
s
| Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_yaml_metadata_block ReaderOptions
opts = do
let sources :: Sources
sources = a -> Sources
forall a. ToSources a => a -> Sources
toSources a
s
let firstSourceName :: SourceName
firstSourceName = case Sources -> [(SourcePos, Text)]
unSources Sources
sources of
((SourcePos
pos,Text
_):[(SourcePos, Text)]
_) -> SourcePos -> SourceName
sourceName SourcePos
pos
[(SourcePos, Text)]
_ -> SourceName
""
let toks :: [Tok]
toks = ((SourcePos, Text) -> [Tok]) -> [(SourcePos, Text)] -> [Tok]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (SourcePos, Text) -> [Tok]
sourceToToks (Sources -> [(SourcePos, Text)]
unSources Sources
sources)
Either ParseError (Future ParserState Meta, Sources)
res <- ParsecT Sources ParserState m (Future ParserState Meta, Sources)
-> ParserState
-> SourceName
-> Sources
-> m (Either ParseError (Future ParserState Meta, Sources))
forall s (m :: * -> *) t u a.
Stream s m t =>
ParsecT s u m a -> u -> SourceName -> s -> m (Either ParseError a)
runParserT (do Future ParserState Meta
meta <- ParsecT Sources ParserState m (Future ParserState MetaValue)
-> ParsecT Sources ParserState m (Future ParserState Meta)
forall st (m :: * -> *).
(HasLastStrPosition st, PandocMonad m) =>
ParsecT Sources st m (Future st MetaValue)
-> ParsecT Sources st m (Future st Meta)
yamlMetaBlock (ReaderOptions
-> ParsecT Sources ParserState m (Future ParserState MetaValue)
forall (m :: * -> *) st.
Monad m =>
ReaderOptions -> ParsecT Sources st m (Future st MetaValue)
metaValueParser ReaderOptions
opts)
SourcePos
pos <- ParsecT Sources ParserState m SourcePos
forall (m :: * -> *) s u. Monad m => ParsecT s u m SourcePos
getPosition
Sources
rest <- ParsecT Sources ParserState m Sources
forall (m :: * -> *) s u. Monad m => ParsecT s u m s
getInput
let rest' :: Sources
rest' = case Sources
rest of
Sources ((SourcePos
_,Text
t):[(SourcePos, Text)]
xs) -> [(SourcePos, Text)] -> Sources
Sources ((SourcePos
pos,Text
t)(SourcePos, Text) -> [(SourcePos, Text)] -> [(SourcePos, Text)]
forall a. a -> [a] -> [a]
:[(SourcePos, Text)]
xs)
Sources
_ -> Sources
rest
(Future ParserState Meta, Sources)
-> ParsecT Sources ParserState m (Future ParserState Meta, Sources)
forall a. a -> ParsecT Sources ParserState m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Future ParserState Meta
meta, Sources
rest'))
ParserState
defaultParserState SourceName
firstSourceName Sources
sources
case Either ParseError (Future ParserState Meta, Sources)
res of
Left ParseError
_ -> ReaderOptions -> Sources -> [Tok] -> m Pandoc
forall (m :: * -> *).
PandocMonad m =>
ReaderOptions -> Sources -> [Tok] -> m Pandoc
readCommonMarkBody ReaderOptions
opts Sources
sources [Tok]
toks
Right (Future ParserState Meta
meta, Sources
rest) -> do
let body :: [Tok]
body = ((SourcePos, Text) -> [Tok]) -> [(SourcePos, Text)] -> [Tok]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (SourcePos, Text) -> [Tok]
sourceToToks (Sources -> [(SourcePos, Text)]
unSources Sources
rest)
Pandoc Meta
_ [Block]
bs <- ReaderOptions -> Sources -> [Tok] -> m Pandoc
forall (m :: * -> *).
PandocMonad m =>
ReaderOptions -> Sources -> [Tok] -> m Pandoc
readCommonMarkBody ReaderOptions
opts Sources
sources [Tok]
body
Pandoc -> m Pandoc
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Pandoc -> m Pandoc) -> Pandoc -> m Pandoc
forall a b. (a -> b) -> a -> b
$ Meta -> [Block] -> Pandoc
Pandoc (Future ParserState Meta -> ParserState -> Meta
forall s a. Future s a -> s -> a
runF Future ParserState Meta
meta ParserState
defaultParserState) [Block]
bs
| Bool
otherwise = do
let sources :: Sources
sources = a -> Sources
forall a. ToSources a => a -> Sources
toSources a
s
let toks :: [Tok]
toks = ((SourcePos, Text) -> [Tok]) -> [(SourcePos, Text)] -> [Tok]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (SourcePos, Text) -> [Tok]
sourceToToks (Sources -> [(SourcePos, Text)]
unSources Sources
sources)
ReaderOptions -> Sources -> [Tok] -> m Pandoc
forall (m :: * -> *).
PandocMonad m =>
ReaderOptions -> Sources -> [Tok] -> m Pandoc
readCommonMarkBody ReaderOptions
opts Sources
sources [Tok]
toks
makeFigures :: Block -> Block
makeFigures :: Block -> Block
makeFigures (Para [Image (Text
ident,[Text]
classes,[(Text, Text)]
kvs) [Inline]
alt (Text
src,Text
tit)]) =
(Text, [Text], [(Text, Text)]) -> Caption -> [Block] -> Block
Figure (Text
ident,[],[])
(Maybe [Inline] -> [Block] -> Caption
Caption Maybe [Inline]
forall a. Maybe a
Nothing [[Inline] -> Block
Plain [Inline]
alt])
[[Inline] -> Block
Plain [(Text, [Text], [(Text, Text)])
-> [Inline] -> (Text, Text) -> Inline
Image (Text
"",[Text]
classes,[(Text, Text)]
kvs) [Inline]
alt (Text
src,Text
tit)]]
makeFigures Block
b = Block
b
sourceToToks :: (SourcePos, Text) -> [Tok]
sourceToToks :: (SourcePos, Text) -> [Tok]
sourceToToks (SourcePos
pos, Text
s) = (Tok -> Tok) -> [Tok] -> [Tok]
forall a b. (a -> b) -> [a] -> [b]
map Tok -> Tok
adjust ([Tok] -> [Tok]) -> [Tok] -> [Tok]
forall a b. (a -> b) -> a -> b
$ SourceName -> Text -> [Tok]
tokenize (SourcePos -> SourceName
sourceName SourcePos
pos) Text
s
where
adjust :: Tok -> Tok
adjust = case SourcePos -> Line
sourceLine SourcePos
pos of
Line
1 -> Tok -> Tok
forall a. a -> a
id
Line
n -> \Tok
tok -> Tok
tok{ tokPos =
incSourceLine (tokPos tok) (n - 1) }
metaValueParser :: Monad m
=> ReaderOptions -> ParsecT Sources st m (Future st MetaValue)
metaValueParser :: forall (m :: * -> *) st.
Monad m =>
ReaderOptions -> ParsecT Sources st m (Future st MetaValue)
metaValueParser ReaderOptions
opts = do
Text
inp <- Text -> ParsecT Sources st m Text -> ParsecT Sources st m Text
forall s (m :: * -> *) t a u.
Stream s m t =>
a -> ParsecT s u m a -> ParsecT s u m a
option Text
"" (ParsecT Sources st m Text -> ParsecT Sources st m Text)
-> ParsecT Sources st m Text -> ParsecT Sources st m Text
forall a b. (a -> b) -> a -> b
$ SourceName -> Text
T.pack (SourceName -> Text)
-> ParsecT Sources st m SourceName -> ParsecT Sources st m Text
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ParsecT Sources st m Char -> ParsecT Sources st m SourceName
forall s (m :: * -> *) t u a.
Stream s m t =>
ParsecT s u m a -> ParsecT s u m [a]
many1 ParsecT Sources st m Char
forall (m :: * -> *) s u.
(Monad m, Stream s m Char, UpdateSourcePos s Char) =>
ParsecT s u m Char
anyChar
let toks :: [Tok]
toks = ((SourcePos, Text) -> [Tok]) -> [(SourcePos, Text)] -> [Tok]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (SourcePos, Text) -> [Tok]
sourceToToks (Sources -> [(SourcePos, Text)]
unSources (Text -> Sources
forall a. ToSources a => a -> Sources
toSources Text
inp))
case Identity (Either ParseError (Cm () Blocks))
-> Either ParseError (Cm () Blocks)
forall a. Identity a -> a
runIdentity (SyntaxSpec Identity (Cm () Inlines) (Cm () Blocks)
-> [Tok] -> Identity (Either ParseError (Cm () Blocks))
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl -> [Tok] -> m (Either ParseError bl)
parseCommonmarkWith (ReaderOptions -> SyntaxSpec Identity (Cm () Inlines) (Cm () Blocks)
forall (m :: * -> *) a.
(Monad m, Typeable m, Typeable a, Rangeable (Cm a Inlines),
Rangeable (Cm a Blocks)) =>
ReaderOptions -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
specFor ReaderOptions
opts) [Tok]
toks) of
Left ParseError
_ -> ParsecT Sources st m (Future st MetaValue)
forall a. ParsecT Sources st m a
forall (m :: * -> *) a. MonadPlus m => m a
mzero
Right (Cm Blocks
bls :: Cm () Blocks) -> Future st MetaValue -> ParsecT Sources st m (Future st MetaValue)
forall a. a -> ParsecT Sources st m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Future st MetaValue -> ParsecT Sources st m (Future st MetaValue))
-> Future st MetaValue
-> ParsecT Sources st m (Future st MetaValue)
forall a b. (a -> b) -> a -> b
$ MetaValue -> Future st MetaValue
forall a. a -> Future st a
forall (m :: * -> *) a. Monad m => a -> m a
return (MetaValue -> Future st MetaValue)
-> MetaValue -> Future st MetaValue
forall a b. (a -> b) -> a -> b
$ Blocks -> MetaValue
forall a. ToMetaValue a => a -> MetaValue
B.toMetaValue Blocks
bls
readCommonMarkBody :: PandocMonad m => ReaderOptions -> Sources -> [Tok] -> m Pandoc
readCommonMarkBody :: forall (m :: * -> *).
PandocMonad m =>
ReaderOptions -> Sources -> [Tok] -> m Pandoc
readCommonMarkBody ReaderOptions
opts Sources
s [Tok]
toks =
(if Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_implicit_figures ReaderOptions
opts
then (Block -> Block) -> Pandoc -> Pandoc
forall a b. Walkable a b => (a -> a) -> b -> b
walk Block -> Block
makeFigures
else Pandoc -> Pandoc
forall a. a -> a
id) (Pandoc -> Pandoc) -> (Pandoc -> Pandoc) -> Pandoc -> Pandoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(if Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_tex_math_gfm ReaderOptions
opts
then (Block -> Block) -> Pandoc -> Pandoc
forall a b. Walkable a b => (a -> a) -> b -> b
walk Block -> Block
handleGfmMath
else Pandoc -> Pandoc
forall a. a -> a
id) (Pandoc -> Pandoc) -> (Pandoc -> Pandoc) -> Pandoc -> Pandoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(if ReaderOptions -> Bool
readerStripComments ReaderOptions
opts
then (Block -> Block) -> Pandoc -> Pandoc
forall a b. Walkable a b => (a -> a) -> b -> b
walk Block -> Block
stripBlockComments (Pandoc -> Pandoc) -> (Pandoc -> Pandoc) -> Pandoc -> Pandoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Inline -> Inline) -> Pandoc -> Pandoc
forall a b. Walkable a b => (a -> a) -> b -> b
walk Inline -> Inline
stripInlineComments
else Pandoc -> Pandoc
forall a. a -> a
id) (Pandoc -> Pandoc) -> m Pandoc -> m Pandoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
if Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_sourcepos ReaderOptions
opts
then case Identity (Either ParseError (Cm SourceRange Blocks))
-> Either ParseError (Cm SourceRange Blocks)
forall a. Identity a -> a
runIdentity (SyntaxSpec
Identity (Cm SourceRange Inlines) (Cm SourceRange Blocks)
-> [Tok] -> Identity (Either ParseError (Cm SourceRange Blocks))
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl -> [Tok] -> m (Either ParseError bl)
parseCommonmarkWith (ReaderOptions
-> SyntaxSpec
Identity (Cm SourceRange Inlines) (Cm SourceRange Blocks)
forall (m :: * -> *) a.
(Monad m, Typeable m, Typeable a, Rangeable (Cm a Inlines),
Rangeable (Cm a Blocks)) =>
ReaderOptions -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
specFor ReaderOptions
opts) [Tok]
toks) of
Left ParseError
err -> PandocError -> m Pandoc
forall a. PandocError -> m a
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (PandocError -> m Pandoc) -> PandocError -> m Pandoc
forall a b. (a -> b) -> a -> b
$ Sources -> ParseError -> PandocError
fromParsecError Sources
s ParseError
err
Right (Cm Blocks
bls :: Cm SourceRange Blocks) -> Pandoc -> m Pandoc
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Pandoc -> m Pandoc) -> Pandoc -> m Pandoc
forall a b. (a -> b) -> a -> b
$ Blocks -> Pandoc
B.doc Blocks
bls
else case Identity (Either ParseError (Cm () Blocks))
-> Either ParseError (Cm () Blocks)
forall a. Identity a -> a
runIdentity (SyntaxSpec Identity (Cm () Inlines) (Cm () Blocks)
-> [Tok] -> Identity (Either ParseError (Cm () Blocks))
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl -> [Tok] -> m (Either ParseError bl)
parseCommonmarkWith (ReaderOptions -> SyntaxSpec Identity (Cm () Inlines) (Cm () Blocks)
forall (m :: * -> *) a.
(Monad m, Typeable m, Typeable a, Rangeable (Cm a Inlines),
Rangeable (Cm a Blocks)) =>
ReaderOptions -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
specFor ReaderOptions
opts) [Tok]
toks) of
Left ParseError
err -> PandocError -> m Pandoc
forall a. PandocError -> m a
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (PandocError -> m Pandoc) -> PandocError -> m Pandoc
forall a b. (a -> b) -> a -> b
$ Sources -> ParseError -> PandocError
fromParsecError Sources
s ParseError
err
Right (Cm Blocks
bls :: Cm () Blocks) -> Pandoc -> m Pandoc
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Pandoc -> m Pandoc) -> Pandoc -> m Pandoc
forall a b. (a -> b) -> a -> b
$ Blocks -> Pandoc
B.doc Blocks
bls
handleGfmMath :: Block -> Block
handleGfmMath :: Block -> Block
handleGfmMath (CodeBlock (Text
"",[Text
"math"],[]) Text
raw) = [Inline] -> Block
Para [MathType -> Text -> Inline
Math MathType
DisplayMath Text
raw]
handleGfmMath Block
x = (Inline -> Inline) -> Block -> Block
forall a b. Walkable a b => (a -> a) -> b -> b
walk Inline -> Inline
handleGfmMathInline Block
x
handleGfmMathInline :: Inline -> Inline
handleGfmMathInline :: Inline -> Inline
handleGfmMathInline (Math MathType
InlineMath Text
math') =
let (Text
ticks, Text
rest) = (Char -> Bool) -> Text -> (Text, Text)
T.span (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'`') Text
math'
in if Text -> Bool
T.null Text
ticks
then MathType -> Text -> Inline
Math MathType
InlineMath Text
math'
else case Text -> Text -> Maybe Text
T.stripSuffix Text
ticks Text
rest of
Just Text
middle | Bool -> Bool
not (Text -> Bool
T.null Text
middle) Bool -> Bool -> Bool
&& (HasCallStack => Text -> Char
Text -> Char
T.last Text
middle Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
/= Char
'`')
-> MathType -> Text -> Inline
Math MathType
InlineMath Text
middle
Maybe Text
_ -> MathType -> Text -> Inline
Math MathType
InlineMath Text
math'
handleGfmMathInline Inline
x = Inline
x
stripBlockComments :: Block -> Block
(RawBlock (B.Format Text
"html") Text
s) =
Format -> Text -> Block
RawBlock (Text -> Format
B.Format Text
"html") (Text -> Text
removeComments Text
s)
stripBlockComments Block
x = Block
x
stripInlineComments :: Inline -> Inline
(RawInline (B.Format Text
"html") Text
s) =
Format -> Text -> Inline
RawInline (Text -> Format
B.Format Text
"html") (Text -> Text
removeComments Text
s)
stripInlineComments Inline
x = Inline
x
removeComments :: Text -> Text
Text
s =
(SourceName -> Text)
-> (Text -> Text) -> Either SourceName Text -> Text
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (Text -> SourceName -> Text
forall a b. a -> b -> a
const Text
s) Text -> Text
forall a. a -> a
id (Either SourceName Text -> Text) -> Either SourceName Text -> Text
forall a b. (a -> b) -> a -> b
$ Parser Text -> Text -> Either SourceName Text
forall a. Parser a -> Text -> Either SourceName a
A.parseOnly Parser Text
pRemoveComments Text
s
where
pRemoveComments :: Parser Text
pRemoveComments = [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat ([Text] -> Text) -> Parser Text [Text] -> Parser Text
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Text -> Parser Text [Text]
forall (m :: * -> *) a. MonadPlus m => m a -> m [a]
A.many'
(Text
"" Text -> Parser Text -> Parser Text
forall a b. a -> Parser Text b -> Parser Text a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ (Text -> Parser Text
A.string Text
"<!--" Parser Text -> Parser Text -> Parser Text
forall a b. Parser Text a -> Parser Text b -> Parser Text b
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> Line -> (Line -> Char -> Maybe Line) -> Parser Text
forall s. s -> (s -> Char -> Maybe s) -> Parser Text
A.scan (Line
0 :: Int) Line -> Char -> Maybe Line
forall {a}. (Num a, Ord a) => a -> Char -> Maybe a
scanChar Parser Text -> Parser Text Char -> Parser Text
forall a b. Parser Text a -> Parser Text b -> Parser Text a
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* Char -> Parser Text Char
A.char Char
'>') Parser Text -> Parser Text -> Parser Text
forall a. Parser Text a -> Parser Text a -> Parser Text a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
((Char -> Bool) -> Parser Text
A.takeWhile1 (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
/= Char
'<')) Parser Text -> Parser Text -> Parser Text
forall a. Parser Text a -> Parser Text a -> Parser Text a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
(Text -> Parser Text
A.string Text
"<"))
scanChar :: a -> Char -> Maybe a
scanChar a
st Char
c =
case Char
c of
Char
'-' -> a -> Maybe a
forall a. a -> Maybe a
Just (a
st a -> a -> a
forall a. Num a => a -> a -> a
+ a
1)
Char
'>' | a
st a -> a -> Bool
forall a. Ord a => a -> a -> Bool
>= a
2 -> Maybe a
forall a. Maybe a
Nothing
Char
_ -> a -> Maybe a
forall a. a -> Maybe a
Just a
0
specFor :: (Monad m, Typeable m, Typeable a,
Rangeable (Cm a Inlines), Rangeable (Cm a Blocks))
=> ReaderOptions -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
specFor :: forall (m :: * -> *) a.
(Monad m, Typeable m, Typeable a, Rangeable (Cm a Inlines),
Rangeable (Cm a Blocks)) =>
ReaderOptions -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
specFor ReaderOptions
opts = ((SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks))
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks))
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a b. (a -> b -> b) -> b -> [a] -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks))
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a b. (a -> b) -> a -> b
($) SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl
defaultSyntaxSpec [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
exts
where
exts :: [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
exts = [ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl
hardLineBreaksSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_hard_line_breaks ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasQuoted il) =>
SyntaxSpec m il bl
smartPunctuationSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_smart ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasStrikethrough il) =>
SyntaxSpec m il bl
strikethroughSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_strikeout ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasSuperscript il) =>
SyntaxSpec m il bl
superscriptSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_superscript ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasSubscript il) =>
SyntaxSpec m il bl
subscriptSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_subscript ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasMath il) =>
SyntaxSpec m il bl
mathSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_tex_math_dollars ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl
fancyListSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_fancy_lists ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsInline il, IsBlock il bl, HasDiv bl) =>
SyntaxSpec m il bl
fencedDivSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_fenced_divs ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsInline il, HasSpan il) =>
SyntaxSpec m il bl
bracketedSpanSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_bracketed_spans ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl) =>
SyntaxSpec m il bl
rawAttributeSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_raw_attribute ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsInline il) =>
SyntaxSpec m il bl
attributesSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_attributes ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, Typeable m, IsBlock il bl, IsInline il, Typeable il,
Typeable bl, HasAlerts il bl) =>
SyntaxSpec m il bl
alertSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_alerts ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasPipeTable il bl) =>
SyntaxSpec m il bl
pipeTableSpec) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_pipe_tables ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl
autolinkSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_autolink_bare_uris ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasEmoji il) =>
SyntaxSpec m il bl
emojiSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_emoji ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, ToPlainText il) =>
SyntaxSpec m il bl
autoIdentifiersSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>)
| Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_gfm_auto_identifiers ReaderOptions
opts
, Bool -> Bool
not (Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_ascii_identifiers ReaderOptions
opts) ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, ToPlainText il) =>
SyntaxSpec m il bl
autoIdentifiersAsciiSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>)
| Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_gfm_auto_identifiers ReaderOptions
opts
, Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_ascii_identifiers ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il) =>
SyntaxSpec m il bl
implicitHeadingReferencesSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>)
| Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_implicit_header_references ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, Typeable m, IsBlock il bl, IsInline il, Typeable il,
Typeable bl, HasFootnote il bl) =>
SyntaxSpec m il bl
footnoteSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_footnotes ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, Typeable il, Typeable bl,
HasDefinitionList il bl) =>
SyntaxSpec m il bl
definitionListSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_definition_lists ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsBlock il bl, IsInline il, HasTaskList il bl) =>
SyntaxSpec m il bl
taskListSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>) | Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_task_lists ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (TitlePosition -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsInline il, HasWikilinks il) =>
TitlePosition -> SyntaxSpec m il bl
wikilinksSpec TitlePosition
TitleAfterPipe SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>)
| Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_wikilinks_title_after_pipe ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (TitlePosition -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) il bl.
(Monad m, IsInline il, HasWikilinks il) =>
TitlePosition -> SyntaxSpec m il bl
wikilinksSpec TitlePosition
TitleBeforePipe SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>)
| Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_wikilinks_title_before_pipe ReaderOptions
opts ] [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
-> [SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)]
forall a. [a] -> [a] -> [a]
++
[ (SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall (m :: * -> *) bl il.
(Monad m, IsInline il, IsBlock il bl) =>
SyntaxSpec m il bl
rebaseRelativePathsSpec SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
-> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)
forall a. Semigroup a => a -> a -> a
<>)
| Extension -> ReaderOptions -> Bool
forall a. HasSyntaxExtensions a => Extension -> a -> Bool
isEnabled Extension
Ext_rebase_relative_paths ReaderOptions
opts ]