Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue May 25, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

Definitely a bug.  Note that pandoc --strict handles this fine.

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Fixed in r1162.

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

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

REALLY fixed in r1163!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant