senchalabs / cssbeautify

Reindent and reformat CSS
http://www.senchalabs.org/cssbeautify/
Apache License 2.0
673 stars 133 forks source link

@font-face fails to format correctly. #36

Open tomgenoni opened 10 years ago

tomgenoni commented 10 years ago

Given the string b{font-family:"a";src:url("b";)}@font-face{font-family:"a";src:url("b";)}

Expected output is:

b {
    font-family: "a";
    src: url("b";);
}

@font-face {
    font-family:"a";
    src:url("b");
}

Actual output:

b {
    font-family: "a";
    src: url("b";);
}

@font-face {
    font-family:"a";src:url("b");
}

The src property should wrap. Oddly it does work if @font-face is first.

Telematica commented 10 years ago

Let's take a look at the code to see what's happening here, 'cause I'm getting that odd output too...