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

Fix view source failures in Internet Explorer. #171

Merged
merged 1 commit into from
Dec 2, 2014

Conversation

mas3
Copy link
Contributor

@mas3 mas3 commented Nov 30, 2014

Fix the below symptoms in Internet Explorer.

  1. Displayed a different code when view source.
  2. Lost a blank line when view source.

@tntim96
Copy link
Owner

tntim96 commented Nov 30, 2014

Thanks, but it would be good to know the IE version and the steps to reproduce the error so I can verify the fix and possibly write a test case - especially with the line split alteration. Also, wouldn't it be better to have:

var lines = response.split(/\r?\n/);

@mas3
Copy link
Contributor Author

mas3 commented Dec 1, 2014

The code does not work correctly if exists <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/> in jscoverage.html.

It might be better to use any one of the following methods.

  1. Delete <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/> in jscoverage.html.
  2. var lines = response.replace(/\r/g, '').split("\n");

@tntim96
Copy link
Owner

tntim96 commented Dec 1, 2014

That "EmulateIE7" does look a problem, but the splitting code looks like it should behave the same. What combination of line endings causes the problem?

tntim96 added a commit that referenced this pull request Dec 2, 2014
Fix view source failures in Internet Explorer.
@tntim96 tntim96 merged commit c4db946 into tntim96:master Dec 2, 2014
@tntim96
Copy link
Owner

tntim96 commented Dec 2, 2014

Turns out your original request is probably the best for now, as the bug for IE7, i.e. "\n\n".split(/\n/) makes an empty array, exists for IE8 too. Your change is merged, but I'll probably remove the IE7 specific code next year.

@mas3 mas3 deleted the viewsource-fix branch December 4, 2014 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants