demydd / pandoc

Automatically exported from code.google.com/p/pandoc
0 stars 0 forks source link

Contents of <style> tags are processed, sometimes resulting in bogus CSS/HTML #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make a file with the following contents:

<style type="text/css">
body {}

</style>

2. Run pandoc --from=markdown on it.

What is the expected output? What do you see instead?

Expected is something like:

<style type="text/css">body {}</style>

Seen is:

<style type="text/css"><p
>body {}</p
></style>

I.e. a <p> tag is wrapped around the contents, because of the blank line
before the closing </style> tag.

Another, worse case is:

<style type="text/css">
/*

* a CSS comment
*
*/
</style>

Which becomes a mess which isn't even valid HTML, let alone CSS:

<style type="text/css"><p
>/*</p
><ul
><li
  >a CSS comment * */</style>

</li
  ></ul
>

What version of the product are you using? On what operating system?

SVN revision 1161 on Windows XP, compiled with the help of Cygwin and GHC
6.8.2.

Please provide any additional information below.

This isn't as bad as it seems, since it's easy to work around: don't put
any blank lines in <style>. Still, it's annoying.

Original issue reported on code.google.com by Deewi...@gmail.com on 30 Dec 2007 at 1:12

GoogleCodeExporter commented 8 years ago
It's worse than I thought:

<style type="text/css">
/* a comment */
body {}
/* another comment */
</style>

This becomes:

<style type="text/css">/* a comment <em
>/ body {} /</em
> another comment */</style>

Note that the `body {}` rule was commented out.

So if you have more than one comment in a CSS <style> block, everything between 
the
first and the last is commented out due to Pandoc messing it up.

Of course, this /can/ be worked around by having only one comment, but that's 
even
more annoying than the no-blank-lines workaround.

Original comment by Deewi...@gmail.com on 30 Dec 2007 at 1:57

GoogleCodeExporter commented 8 years ago
Definitely a bug.  Note that pandoc --strict handles this fine.

Original comment by fiddloso...@gmail.com on 30 Dec 2007 at 4:16

GoogleCodeExporter commented 8 years ago
Fixed in r1162.

Original comment by fiddloso...@gmail.com on 31 Dec 2007 at 12:05

GoogleCodeExporter commented 8 years ago
REALLY fixed in r1163!

Original comment by fiddloso...@gmail.com on 31 Dec 2007 at 12:46