mutian / Sublime-CSS-Format

CSS Formatting for Sublime Text
http://mutian.github.io/Sublime-CSS-Format/
MIT License
98 stars 27 forks source link

Some Comment Tags Break on Format #24

Closed erier closed 9 years ago

erier commented 9 years ago

First, excellent plugin! I use it all the time.

I came across a bit of an issue today, however.

Whenever there are comments like this:

/********************/
/* HERE's A SAMPLE */
/********************/

and CSS Format is run, it comes out like this:

/******************** /
/* HERE's A SAMPLE */
/******************** /

As you can see by the end of this output /******************** /, this is not good for the CSS that follows the comment as the comment hasn't been closed.

I've gone ahead and taken out all instances of /********************/ in my work to avoid the issue, but others may miss this and not be so lucky.

Before Formatting screen shot 2014-11-20 at 5 21 36 pm After Formatting screen shot 2014-11-20 at 5 22 08 pm

Cheers -

thecotne commented 9 years ago

problem with comments still exists

before before

after after

before before

after after

mutian commented 9 years ago

Hi, I've optimized this formater, it will keep the content format in comments, so the code like this comment1 and this comment2 are both ok.

In order to adapt to more usage scenarios, it will add new line break between comment blocks, so the code like this

/*** Components ***/
/** Content Objects **/
/* form */

will format to:

/*** Components ***/

/** Content Objects **/

/* form */

But the code like this

/********************/
/* HERE's A SAMPLE */
/********************/

will be also formatting to:

/********************/

/* HERE's A SAMPLE */

/********************/

Hope I can meet your needs.