简体   繁体   中英

HTML TIDY not indenting inline tags and script tags properly

I am trying to use HTMLTIDY for indenting my html file. I am using the command line version of it.

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 indenting everything properly except the script tags and inline elements are coming in the same line instead of indenting.

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 am unable to figure out any options as per the documention to fix it. please help me solving this.

balthisar commented on 1 Feb:

Fixed in develop-500. Please feel free to re-open this if you still have a problem. Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM