Sublime Forum

Html-css-js-prettify (disable the new line)

#1

Hello, I found a great plugin Html-css-js-prettify. Everything is fine, except that by default it carries the comments in the HTML document to a new line. When large blocks div, I love near the end tag to write a comment, for example:

<div class = "carousel">
    <div class = "carousel-wrapper">
        <div class = "carousel-items">
            ...... There are many line .......
        </div> <!-- .carousel-items -->
    </div> <!-- .carousel-wrapper -->
</div> <!-- .carousel -->

After the plugin I get

<div class = "carousel">
    <div class = "carousel-wrapper">
        <div class = "carousel-items">
            ...... There are many line ......
        </div>
        <!-- .carousel-items -->
    </div>
    <!-- .carousel-wrapper -->
</div>
<!-- .carousel -->

For me, this record is not familiar, just confused. Default settings to change all tried - does not help. I tried to edit the plugin * .js files. Like as in beautify-html.js file there is something about these comments and how to handle them, but my knowledge is not enough to properly edit the file.

As an alternative, I’d arranged an option, when the plugin Html-css-js-prettify do not create new lines, but simply using the correct number of spaces builds the correct nesting of the code.

Sorry for my English, I use a translator. Thank you.

1 Like

#2

I share Dmitriy’s exact sentiment. I love the “HTML-CSS-JS Prettify” plugin for everything except that it indents comments into a new line rather than keeping it on the same line. I have poked around and could not find a solution to this.

0 Likes

#3

I am facing the same issue. Is there any solution to this issue yet? Any better HTML formatter, which doesn’t screw up the comments.

0 Likes