diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Options.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs index 4f73cd99e..73f7a2039 100644 --- a/src/Text/Pandoc/Options.hs +++ b/src/Text/Pandoc/Options.hs @@ -84,6 +84,7 @@ data Extension = | Ext_markdown_in_html_blocks -- ^ Interpret as markdown inside HTML blocks | Ext_native_divs -- ^ Use Div blocks for contents of <div> tags | Ext_native_spans -- ^ Use Span inlines for contents of <span> + | Ext_bracketed_spans -- ^ Bracketed spans with attributes | Ext_markdown_attribute -- ^ Interpret text inside HTML as markdown -- iff container has attribute 'markdown' | Ext_escaped_line_breaks -- ^ Treat a backslash at EOL as linebreak @@ -145,6 +146,7 @@ pandocExtensions = Set.fromList , Ext_markdown_in_html_blocks , Ext_native_divs , Ext_native_spans + , Ext_bracketed_spans , Ext_escaped_line_breaks , Ext_fancy_lists , Ext_startnum diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 9928500dc..2e95c518d 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1482,6 +1482,7 @@ inline = choice [ whitespace , strongOrEmph , note , cite + , bracketedSpan , link , image , math @@ -1750,6 +1751,13 @@ link = try $ do setState $ st{ stateAllowLinks = True } regLink B.linkWith lab <|> referenceLink B.linkWith (lab,raw) +bracketedSpan :: MarkdownParser (F Inlines) +bracketedSpan = try $ do + guardEnabled Ext_bracketed_spans + (lab,_) <- reference + attr <- attributes + return $ B.spanWith attr <$> lab + regLink :: (Attr -> String -> String -> Inlines -> Inlines) -> F Inlines -> MarkdownParser (F Inlines) regLink constructor lab = try $ do |