AnantLabs / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

internet explorer 8 shows the pre tag as one long line #128

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.view a few lines of prettifier code in ie8
2.see the result as one long line
3.click compatibility view to correct the issue

(Please include HTML, not just your source code)

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

What version are you using?  On what browser?
prettify-small-21-Jul-2010
on internet explorer 8

Please provide any additional information below.

Original issue reported on code.google.com by roio...@gmail.com on 5 Sep 2010 at 8:37

GoogleCodeExporter commented 9 years ago
If you can visit 
http://google-code-prettify.googlecode.com/svn/trunk/tests/ie-newline-copy-paste
.html  and follow the instructions there, it would help me collect info to 
address this issue.

Original comment by mikesamuel@gmail.com on 10 Mar 2011 at 1:35

GoogleCodeExporter commented 9 years ago
Wondering if you have heard of "multiple IE". The description provided on the 
home page (http://utilu.com/IECollection/) sounds interesting.

Original comment by schwarze...@hotmail.com on 19 Mar 2011 at 11:32

GoogleCodeExporter commented 9 years ago
Selecting and copying the text also does not work in IE8.

>> What steps will reproduce the problem?

1. Visit http://google-code-prettify.googlecode.com/svn/trunk/README.html in IE8

2. Copy any prettified text e.g. the prettified lines inside the setup section.

3. Paste in notepad, save as whatever.txt

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

Expected:

<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>

Actual:

<link href="prettify.css" type="text/css" rel="stylesheet" /> <script 
type="text/javascript" src="prettify.js"></script>

>> What version are you using?  On what browser?

r120 by mikesamuel on Nov 16, 2010
on Internet Explorer 8.0.6001

>> Please provide any additional information below.

It is worth mentioning that when you inspect whatever.txt in a HEX editor, you 
see a space (ASCII 0x20) where you expect to see new line (ASCII 0x0D 0x0A) 
(this what you 
get when you copy the same thing from the same page using FireFox).

Original comment by schwarze...@hotmail.com on 19 Mar 2011 at 11:46

GoogleCodeExporter commented 9 years ago
P.S: I've checked again. Before prettyPrint()ing the pre block, the code copied 
file. Once the pre block is prettified there is apparently no way to get the 
code with new lines. I am afraid this renders the script very much useless.

Original comment by schwarze...@hotmail.com on 19 Mar 2011 at 12:01

GoogleCodeExporter commented 9 years ago
I understand the severity of the problem and will work on it once I can find a 
suitable test setup.

Thanks for the link to multiple IE.  I'll look into it.

Original comment by mikesamuel@gmail.com on 21 Mar 2011 at 4:38

GoogleCodeExporter commented 9 years ago
Adding the word-wrap style in the following line of prettify.css seems to fix 
the issue.

pre.prettyprint { padding: 2px; border: 1px solid #888; word-wrap: break-word }

The Firefox 4 has the similar problem. Adding the wrap attribute to <pre> tag 
as follows seems to fix the issue.

<pre class="prettyprint" wrap>

Original comment by y.whitef...@gmail.com on 15 May 2011 at 2:51

GoogleCodeExporter commented 9 years ago
I reworked prettify to manipulate DOM nodes instead of injecting HTML via 
innerHTML.  Does the latest trunk revision address this problem without CSS 
changes?

Original comment by mikesamuel@gmail.com on 16 May 2011 at 6:14

GoogleCodeExporter commented 9 years ago
Regarding comment #3, I was unable to reproduce the problem in IE8 (and 
emulated IE7 standards mode in IE8) using r177 :)

Original comment by schwarze...@hotmail.com on 17 May 2011 at 5:59

GoogleCodeExporter commented 9 years ago
>> Comment 7
Yes, r177 seems to fix the issue 128. No need to change CSS.
I apologize for my misunderstanding the original issue in the comment 6.
I was writing about another matter that is specific to Blogger post content.
If the google-code-prettify is used in Blogger posts, Chrome wraps long lines 
without any additional attributes and styles, on the other hand, Firefox 4 and 
IE 8 do not. The 'wrap' attribute is needed for Firefox 4, and the 'word-wrap: 
break-word' style is needed for IE 8.

Original comment by y.whitef...@gmail.com on 25 May 2011 at 7:22