jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.03k stars 3.35k forks source link

Eating up newlines in embedded HTML <pre> tag #2804

Closed borisvassilev closed 8 years ago

borisvassilev commented 8 years ago

This is a regression from the previous release, very easy to reproduce. With the latest version:

$ pandoc --version
pandoc 1.17.0.1
Compiled with texmath 0.8.5, highlighting-kate 0.6.2.
Syntax highlighting is supported for the following languages:
    abc, actionscript, ada, agda, apache, asn1, asp, awk, bash, bibtex, boo, c,
    changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css,
    curry, d, diff, djangotemplate, dockerfile, dot, doxygen, doxygenlua, dtd,
    eiffel, elixir, email, erlang, fasm, fortran, fsharp, gcc, glsl,
    gnuassembler, go, hamlet, haskell, haxe, html, idris, ini, isocpp, java,
    javadoc, javascript, json, jsp, julia, kotlin, latex, lex, lilypond,
    literatecurry, literatehaskell, llvm, lua, m4, makefile, mandoc, markdown,
    mathematica, matlab, maxima, mediawiki, metafont, mips, modelines, modula2,
    modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml, octave,
    opencl, pascal, perl, php, pike, postscript, prolog, pure, python, r,
    relaxng, relaxngcompact, rest, rhtml, roff, ruby, rust, scala, scheme, sci,
    sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, tcsh, texinfo, verilog, vhdl,
    xml, xorg, xslt, xul, yacc, yaml, zsh
Default user data directory: /home/boris/.pandoc
Copyright (C) 2006-2015 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
> ~
$ cat foo.pandoc
<pre>
foo
bar
</pre>
> ~
$ pandoc foo.pandoc 
<pre>foobar</pre>

Obviously, all space in <pre> should be preserved, but isn't.

jgm commented 8 years ago

htmlInBalanced from Text.Pandoc.Readers is the culprit. It got rewritten in 1.17. I see the problem.

jgm commented 8 years ago

Fixed, and sorry about that one.

borisvassilev commented 8 years ago

Thank you for fixing this right away!

jgm commented 8 years ago

Release out now, 1.17.0.2.