diff options
-rw-r--r-- | README | 10 | ||||
-rw-r--r-- | src/Text/Pandoc/Options.hs | 10 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 8 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 2 |
4 files changed, 15 insertions, 15 deletions
@@ -2917,7 +2917,7 @@ nonbreaking space after the image: ![This image won't be a figure](/url/of/image.png)\ -#### Extension: `common_link_attributes` #### +#### Extension: `link_attributes` #### Attributes can be set on links and images: @@ -3270,11 +3270,11 @@ Causes the identifiers produced by `auto_identifiers` to be pure ASCII. Accents are stripped off of accented latin letters, and non-latin letters are omitted. -#### Extension: `link_attributes` #### +#### Extension: `mmd_link_attributes` #### Parses multimarkdown style key-value attributes on link and image references. This extension should not be confused with the -[`common_link_attributes`](#extension-common_link_attributes) extension. +[`link_attributes`](#extension-link_attributes) extension. This is a reference ![image][ref] with multimarkdown attributes. @@ -3322,7 +3322,7 @@ variants are supported: `markdown_phpextra` (PHP Markdown Extra) : `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`, `fenced_code_blocks`, `definition_lists`, `intraword_underscores`, - `header_attributes`, `common_link_attributes`, `abbreviations`, + `header_attributes`, `link_attributes`, `abbreviations`, `shortcut_reference_links`. `markdown_github` (GitHub-Flavored Markdown) @@ -3333,7 +3333,7 @@ variants are supported: `shortcut_reference_links`. `markdown_mmd` (MultiMarkdown) -: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`, +: `pipe_tables` `raw_html`, `markdown_attribute`, `mmd_link_attributes`, `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`, `mmd_title_block`, `footnotes`, `definition_lists`, `all_symbols_escapable`, `implicit_header_references`, diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs index 1dc3bad3a..b25c47000 100644 --- a/src/Text/Pandoc/Options.hs +++ b/src/Text/Pandoc/Options.hs @@ -86,8 +86,8 @@ data Extension = | 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 - | Ext_common_link_attributes -- ^ link and image attributes - | Ext_link_attributes -- ^ MMD style reference link attributes + | Ext_link_attributes -- ^ link and image attributes + | Ext_mmd_link_attributes -- ^ MMD style reference link attributes | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links | Ext_fancy_lists -- ^ Enable fancy list numbers and delimiters | Ext_lists_without_preceding_blankline -- ^ Allow lists without preceding blank @@ -156,7 +156,7 @@ pandocExtensions = Set.fromList , Ext_subscript , Ext_auto_identifiers , Ext_header_attributes - , Ext_common_link_attributes + , Ext_link_attributes , Ext_implicit_header_references , Ext_line_blocks , Ext_shortcut_reference_links @@ -190,7 +190,7 @@ phpMarkdownExtraExtensions = Set.fromList , Ext_definition_lists , Ext_intraword_underscores , Ext_header_attributes - , Ext_common_link_attributes + , Ext_link_attributes , Ext_abbreviations , Ext_shortcut_reference_links ] @@ -218,7 +218,7 @@ multimarkdownExtensions = Set.fromList [ Ext_pipe_tables , Ext_raw_html , Ext_markdown_attribute - , Ext_link_attributes + , Ext_mmd_link_attributes , Ext_raw_tex , Ext_tex_math_double_backslash , Ext_intraword_underscores diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index fd16a5f75..d0c03062a 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -368,15 +368,15 @@ referenceKey = try $ do let sourceURL = liftM unwords $ many $ try $ do skipMany spaceChar notFollowedBy' referenceTitle - notFollowedBy' $ guardEnabled Ext_common_link_attributes >> attributes + notFollowedBy' $ guardEnabled Ext_link_attributes >> attributes notFollowedBy' (() <$ reference) many1 $ notFollowedBy space >> litChar let betweenAngles = try $ char '<' >> manyTill litChar (char '>') src <- try betweenAngles <|> sourceURL tit <- option "" referenceTitle attr <- option nullAttr $ try $ - guardEnabled Ext_common_link_attributes >> skipSpaces >> attributes - addKvs <- option [] $ guardEnabled Ext_link_attributes + guardEnabled Ext_link_attributes >> skipSpaces >> attributes + addKvs <- option [] $ guardEnabled Ext_mmd_link_attributes >> many (try $ spnl >> keyValAttr) blanklines let attr' = extractIdClass $ foldl (\x f -> f x) attr addKvs @@ -1729,7 +1729,7 @@ regLink :: (Attr -> String -> String -> Inlines -> Inlines) regLink constructor lab = try $ do (src, tit) <- source attr <- option nullAttr $ - guardEnabled Ext_common_link_attributes >> attributes + guardEnabled Ext_link_attributes >> attributes return $ constructor attr src tit <$> lab -- a link like [this][ref] or [this][] or [this] diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 898e6c32d..731fa86c4 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -287,7 +287,7 @@ attrsToMarkdown attribs = braces $ hsep [attribId, attribClasses, attribKeys] linkAttributes :: WriterOptions -> Attr -> Doc linkAttributes opts attr = - if isEnabled Ext_common_link_attributes opts && attr /= nullAttr + if isEnabled Ext_link_attributes opts && attr /= nullAttr then attrsToMarkdown attr else empty |