diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-11-19 22:58:19 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-11-19 23:17:50 -0800 |
commit | 73e2d7976c06cc6087f2c4a63538593076fb5623 (patch) | |
tree | a9efd542f30a1e07df3b837897c07d9884f51619 /src/Text/Pandoc | |
parent | 244cd5644b44f43722530379138bd7bb9cbace9b (diff) | |
download | pandoc-73e2d7976c06cc6087f2c4a63538593076fb5623.tar.gz |
Renamed link attribute extensions.
* Old `link_attributes` -> `mmd_link_attributes`
* Recently added `common_link_attributes` -> `link_attributes`
Note: this change could break some existing workflows.
Diffstat (limited to 'src/Text/Pandoc')
-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 |
3 files changed, 10 insertions, 10 deletions
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 |