Js-beautify: Omit newline before/after <head>/<body> tag

Created on 1 Mar 2017  路  2Comments  路  Source: beautify-web/js-beautify

Is there an option to omit newline before/after / tag?

Input

<html>
<head></head>
<body></body>
</html>

Expected Output

<html>
<head></head>
<body></body>
</html>

Actual Output

<html>

<head></head>

<body></body>

</html>

if indent_head_inner_html/indent_body_inner_html is true, the new line seems useless.

Most helpful comment

-E, --extra_liners List of tags (defaults to [head,body,/html] that should have an extra newline before them.

var options={
    html: {
        extra_liners: []
    }
}

All 2 comments

-E, --extra_liners List of tags (defaults to [head,body,/html] that should have an extra newline before them.

var options={
    html: {
        extra_liners: []
    }
}

@thilomaurer - Thanks for pointing that out!

Was this page helpful?
0 / 5 - 0 ratings