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

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

Open
GoogleCodeExporter opened this issue Jan 14, 2016 · 9 comments
Open

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

GoogleCodeExporter opened this issue Jan 14, 2016 · 9 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 5 Sep 2010 at 8:37

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 10 Mar 2011 at 1:35

@GoogleCodeExporter
Copy link
Author

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

Original comment by [email protected] on 19 Mar 2011 at 11:32

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Mar 2011 at 11:46

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Mar 2011 at 12:01

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 21 Mar 2011 at 4:38

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 15 May 2011 at 2:51

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 16 May 2011 at 6:14

@GoogleCodeExporter
Copy link
Author

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

Original comment by [email protected] on 17 May 2011 at 5:59

@GoogleCodeExporter
Copy link
Author

>> 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 [email protected] on 25 May 2011 at 7:22

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