jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.97k stars 3.34k forks source link

fenced_code_attributes: documentation or code is wrong... #1557

Closed docwhat closed 9 years ago

docwhat commented 10 years ago

The documentation for fenced_code_attributes says:

If the fenced_code_attributes extension is disabled, but input contains class attribute(s) for the codeblock, the first class attribute will be printed after the opening fence as a bare word.

However, when given this input:

~~~ sh
echo 'hi'
~~~

And running with pandoc --to=markdown-fenced_code_attributes I get this output:

~~~~
echo 'hi'
~~~~

I expected to get this instead:

~~~~ sh
echo 'hi'
~~~~

If I run this command pandoc --to=markdown-fenced_code_blocks I get something closer to what I expect:

``` sh
echo 'hi'


It leads me to believe either I don't understand `fenced_code_blocks` and `fenced_code_attributes`.
jgm commented 10 years ago

What does pandoc --version say? The documentation reflects the latest version 1.13.0.1.

docwhat commented 10 years ago

It's 1.13.0.1 from Homebrew.

docwhat commented 10 years ago

Full output of --version:

pandoc 1.13.0.1
Compiled with texmath 0.8, highlighting-kate 0.5.8.5.
Syntax highlighting is supported for the following languages:
    actionscript, ada, apache, asn1, asp, awk, bash, bibtex, boo, c, changelog,
    clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css, curry, d,
    diff, djangotemplate, doxygen, doxygenlua, dtd, eiffel, email, erlang,
    fortran, fsharp, gcc, gnuassembler, go, haskell, haxe, html, ini, isocpp,
    java, javadoc, javascript, json, jsp, julia, latex, lex, literatecurry,
    literatehaskell, lua, makefile, mandoc, markdown, matlab, maxima, metafont,
    mips, modelines, modula2, modula3, monobasic, nasm, noweb, objectivec,
    objectivecpp, ocaml, octave, pascal, perl, php, pike, postscript, prolog,
    pure, python, r, relaxngcompact, restructuredtext, rhtml, roff, ruby, rust,
    scala, scheme, sci, sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, texinfo,
    verilog, vhdl, xml, xorg, xslt, xul, yacc, yaml
Default user data directory: /Users/docwhat/.pandoc
Copyright (C) 2006-2014 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
jgm commented 10 years ago

Here's what I'm seeing with 1.13.0.1:

% pandoc --to=markdown-fenced_code_attributes
~~~ sh
echo 'hi'
~~~
^D
``` sh
echo 'hi'
```

So I can't reproduce what you're seeing. Are you sure you were running 1.13.0.1 and not an older version on your system? Did you use other options that might be interfering?

mpickering commented 9 years ago

Can't reproduce this issue either.