HTML TIDY is indented for inline tags and script tags

I am trying to use HTMLTIDY for indentation in my html file. I am using its command line version.

tidy --doctype html5 --tidy-mark no --indent auto --indent-spaces 4 --wrap 0 --write-back yes --output-html yes --drop-empty-elements no filename.html

Its indentation is all correct, except that script tags and inline elements are on the same line instead of indentation.

Before:

<!DOCTYPE html><html><head>
<script type="text/javascript" src="something.js"></script>
<script type="text/javascript" src="something.js"></script>
<script type="text/javascript" src="something.js"></script>
<title>sometitle</title>
</head><body><div class="test"><a href="#">testlink1</a><a href="#">testlink1</a><a href="#">testlink1</a></div></body>
</html>

after

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <script type="text/javascript" src="something.js">
</script>
    <script type="text/javascript" src="something.js">
</script>
    <script type="text/javascript" src="something.js">
</script>

    <title>sometitle</title>
</head>

<body>
    <div class="test">
        <a href="#">testlink1</a><a href="#">testlink1</a><a href="#">testlink1</a>
    </div>
</body>
</html>

I cannot determine any parameters according to the documentation to fix this. help me solve this.

+4
source share
1 answer

balthisar commented on February 1st:

Fixed in development-500. Feel free to reopen this if you still have a problem. Thank!

+1
source

Source: https://habr.com/ru/post/1542925/


All Articles