Skip to content

Commit

Permalink
Markdown writer: don't use braced attributes for fenced code.
Browse files Browse the repository at this point in the history
Removed `Ext_fenced_code_attributes` from `markdown_github`
extensions.

If this extension is not set, the first class attribute will
be printed after the opening fence as a bare word.

Closes #1416.
  • Loading branch information
jgm committed Jul 11, 2014
1 parent 05a5b4e commit 7654db9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -2634,7 +2634,7 @@ variants are supported:

`markdown_github` (Github-flavored Markdown)
: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
`fenced_code_blocks`, `fenced_code_attributes`, `auto_identifiers`,
`fenced_code_blocks`, `auto_identifiers`,
`ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
`intraword_underscores`, `strikeout`, `hard_line_breaks`

Expand Down
1 change: 0 additions & 1 deletion src/Text/Pandoc/Options.hs
Expand Up @@ -163,7 +163,6 @@ githubMarkdownExtensions = Set.fromList
, Ext_raw_html
, Ext_tex_math_single_backslash
, Ext_fenced_code_blocks
, Ext_fenced_code_attributes
, Ext_auto_identifiers
, Ext_ascii_identifiers
, Ext_backtick_code_blocks
Expand Down
4 changes: 2 additions & 2 deletions src/Text/Pandoc/Writers/Markdown.hs
Expand Up @@ -405,8 +405,8 @@ blockToMarkdown opts (CodeBlock attribs str) = return $
attrs = if isEnabled Ext_fenced_code_attributes opts
then nowrap $ " " <> attrsToMarkdown attribs
else case attribs of
(_,[cls],_) -> " " <> text cls
_ -> empty
(_,(cls:_),_) -> " " <> text cls
_ -> empty
blockToMarkdown opts (BlockQuote blocks) = do
st <- get
-- if we're writing literate haskell, put a space before the bird tracks
Expand Down

0 comments on commit 7654db9

Please sign in to comment.