git.iko.soy/typeable/pandoc
on master help sign in
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.

commit73e2d7976c06cc6087f2c4a63538593076fb5623 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 19 Nov 2015, 22:58 (11 years ago) parent244cd56
4 files changed+15−15
README+5−5 src/Text/Pandoc/Options.hs+5−5 src/Text/Pandoc/Readers/Markdown.hs+4−4 src/Text/Pandoc/Writers/Markdown.hs+1−1
README+5−5
@@ -2917,7 +2917,7 @@ nonbreaking space after the image:
29172917
29182918 ![This image won't be a figure](/url/of/image.png)\
29192919
2920−#### Extension: `common_link_attributes` ####
2920+#### Extension: `link_attributes` ####
29212921
29222922Attributes can be set on links and images:
29232923
@@ -3270,11 +3270,11 @@ Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
32703270Accents are stripped off of accented latin letters, and non-latin
32713271letters are omitted.
32723272
3273−#### Extension: `link_attributes` ####
3273+#### Extension: `mmd_link_attributes` ####
32743274
32753275Parses multimarkdown style key-value attributes on link
32763276and image references. This extension should not be confused with the
3277−[`common_link_attributes`](#extension-common_link_attributes) extension.
3277+[`link_attributes`](#extension-link_attributes) extension.
32783278
32793279 This is a reference ![image][ref] with multimarkdown attributes.
32803280
@@ -3322,7 +3322,7 @@ variants are supported:
33223322`markdown_phpextra` (PHP Markdown Extra)
33233323: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
33243324 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
3325− `header_attributes`, `common_link_attributes`, `abbreviations`,
3325+ `header_attributes`, `link_attributes`, `abbreviations`,
33263326 `shortcut_reference_links`.
33273327
33283328`markdown_github` (GitHub-Flavored Markdown)
@@ -3333,7 +3333,7 @@ variants are supported:
33333333 `shortcut_reference_links`.
33343334
33353335`markdown_mmd` (MultiMarkdown)
3336−: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
3336+: `pipe_tables` `raw_html`, `markdown_attribute`, `mmd_link_attributes`,
33373337 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
33383338 `mmd_title_block`, `footnotes`, `definition_lists`,
33393339 `all_symbols_escapable`, `implicit_header_references`,
src/Text/Pandoc/Options.hs+5−5
@@ -86,8 +86,8 @@ data Extension =
8686 | Ext_markdown_attribute -- ^ Interpret text inside HTML as markdown
8787 -- iff container has attribute 'markdown'
8888 | Ext_escaped_line_breaks -- ^ Treat a backslash at EOL as linebreak
89− | Ext_common_link_attributes -- ^ link and image attributes
90− | Ext_link_attributes -- ^ MMD style reference link attributes
89+ | Ext_link_attributes -- ^ link and image attributes
90+ | Ext_mmd_link_attributes -- ^ MMD style reference link attributes
9191 | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links
9292 | Ext_fancy_lists -- ^ Enable fancy list numbers and delimiters
9393 | Ext_lists_without_preceding_blankline -- ^ Allow lists without preceding blank
@@ -156,7 +156,7 @@ pandocExtensions = Set.fromList
156156 , Ext_subscript
157157 , Ext_auto_identifiers
158158 , Ext_header_attributes
159− , Ext_common_link_attributes
159+ , Ext_link_attributes
160160 , Ext_implicit_header_references
161161 , Ext_line_blocks
162162 , Ext_shortcut_reference_links
@@ -190,7 +190,7 @@ phpMarkdownExtraExtensions = Set.fromList
190190 , Ext_definition_lists
191191 , Ext_intraword_underscores
192192 , Ext_header_attributes
193− , Ext_common_link_attributes
193+ , Ext_link_attributes
194194 , Ext_abbreviations
195195 , Ext_shortcut_reference_links
196196 ]
@@ -218,7 +218,7 @@ multimarkdownExtensions = Set.fromList
218218 [ Ext_pipe_tables
219219 , Ext_raw_html
220220 , Ext_markdown_attribute
221− , Ext_link_attributes
221+ , Ext_mmd_link_attributes
222222 , Ext_raw_tex
223223 , Ext_tex_math_double_backslash
224224 , Ext_intraword_underscores
src/Text/Pandoc/Readers/Markdown.hs+4−4
@@ -368,15 +368,15 @@ referenceKey = try $ do
368368 let sourceURL = liftM unwords $ many $ try $ do
369369 skipMany spaceChar
370370 notFollowedBy' referenceTitle
371− notFollowedBy' $ guardEnabled Ext_common_link_attributes >> attributes
371+ notFollowedBy' $ guardEnabled Ext_link_attributes >> attributes
372372 notFollowedBy' (() <$ reference)
373373 many1 $ notFollowedBy space >> litChar
374374 let betweenAngles = try $ char '<' >> manyTill litChar (char '>')
375375 src <- try betweenAngles <|> sourceURL
376376 tit <- option "" referenceTitle
377377 attr <- option nullAttr $ try $
378− guardEnabled Ext_common_link_attributes >> skipSpaces >> attributes
379− addKvs <- option [] $ guardEnabled Ext_link_attributes
378+ guardEnabled Ext_link_attributes >> skipSpaces >> attributes
379+ addKvs <- option [] $ guardEnabled Ext_mmd_link_attributes
380380 >> many (try $ spnl >> keyValAttr)
381381 blanklines
382382 let attr' = extractIdClass $ foldl (\x f -> f x) attr addKvs
@@ -1729,7 +1729,7 @@ regLink :: (Attr -> String -> String -> Inlines -> Inlines)
17291729regLink constructor lab = try $ do
17301730 (src, tit) <- source
17311731 attr <- option nullAttr $
1732− guardEnabled Ext_common_link_attributes >> attributes
1732+ guardEnabled Ext_link_attributes >> attributes
17331733 return $ constructor attr src tit <$> lab
17341734
17351735-- a link like [this][ref] or [this][] or [this]
src/Text/Pandoc/Writers/Markdown.hs+1−1
@@ -287,7 +287,7 @@ attrsToMarkdown attribs = braces $ hsep [attribId, attribClasses, attribKeys]
287287
288288linkAttributes :: WriterOptions -> Attr -> Doc
289289linkAttributes opts attr =
290− if isEnabled Ext_common_link_attributes opts && attr /= nullAttr
290+ if isEnabled Ext_link_attributes opts && attr /= nullAttr
291291 then attrsToMarkdown attr
292292 else empty
293293