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

html conditional tag treated as open tag "<!--[if IE 8]>" #222

Closed
bitwiseman opened this issue Apr 3, 2013 · 3 comments
Closed

html conditional tag treated as open tag "<!--[if IE 8]>" #222

bitwiseman opened this issue Apr 3, 2013 · 3 comments

Comments

@bitwiseman
Copy link
Member

Using index.html from jsbeautifier.org as a test, the following misformatting occurs in conditional html comments:

Input:

<!DOCTYPE html>
<!--[if lt IE 7]><html lang="en-us" class="ie6"><![endif]-->
<!--[if IE 7]><html lang="en-us" class="ie7"><![endif]-->
<!--[if IE 8]><html lang="en-us" class="ie8"><![endif]-->
<!--[if gt IE 8]><!--><html lang="en-us"><!--<![endif]-->

Output:

<!DOCTYPE html>
<!--[if lt IE 7]>
    <html lang="en-us" class="ie6">
    <![endif]-->
    <!--[if IE 7]>
        <html lang="en-us" class="ie7">
        <![endif]-->
        <!--[if IE 8]>
            <html lang="en-us" class="ie8">
            <![endif]-->
            <!--[if gt IE 8]>
                <!-->
                <html lang="en-us">
                <!--<![endif]-->

I'm not sure what the correct formatting is, though even unchanged would be better than the current output.

@evocateur
Copy link
Contributor

Technically, these are comments, and should be untouched, as such. (The last line ends the comment before the <html> tag, but it is conventionally aligned with the other comments)

@paulmsmith
Copy link

I'm having this same issue. Seems all the tidy/beautifiers I've tried suffer this problem. You chaps got to the bottom of it yet? Cheers. :)

@bitwiseman
Copy link
Member Author

Duplicate of #91

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

3 participants