Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
缩进<;头>;及<;车身>;使用htmltidy_Html_Macos_Command Line_Htmltidy - Fatal编程技术网

缩进<;头>;及<;车身>;使用htmltidy

缩进<;头>;及<;车身>;使用htmltidy,html,macos,command-line,htmltidy,Html,Macos,Command Line,Htmltidy,我想缩进 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <ul> <li>List 1</li> <li>List 2</li>

我想缩进

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>List 1</li>
        <li>List 2</li>
        <li>List 3</li>
        <li>List 4</li>
        <li>List 5</li>
    </ul>
</body>
</html>
该版本为:
HTML-Tidy,适用于苹果macOS 5.6.0版

我浏览了一遍,尝试了几件事,但没有成功

缺少什么?

问题在于您的选项
indent:auto
。在中,您可以阅读:

如果设置为自动整理,将决定是否缩进标记的内容,例如
基于包括块的内容的as、
  • 或- 级别元素。
  • 当您将
    indent
    设置为
    yes
    时,您的
    部分将缩进,但您可能不喜欢的所有列表项也将缩进:

    
    文件
    
    • 清单1
    • 清单2
    • 清单3
    • 清单4
    • 清单5

    仅供参考:除了将
    tidy
    的所有选项写入配置文件之外,您还可以通过在每个选项前面加上
    --
    并添加以空格分隔的值,将它们作为选项传递。产生上述输出的最小命令是:

    tidy--indent yes--indent spaces 4--quiet yes--tidy mark no index.html
    
    在某些情况下可能有用。

    问题在于您的选项
    indent:auto
    。在中,您可以阅读:

    如果设置为自动整理,将决定是否缩进标记的内容,例如
    基于包括块的内容的as、
  • 或- 级别元素。
  • 当您将
    indent
    设置为
    yes
    时,您的
    部分将缩进,但您可能不喜欢的所有列表项也将缩进:

    
    文件
    
    • 清单1
    • 清单2
    • 清单3
    • 清单4
    • 清单5

    仅供参考:除了将
    tidy
    的所有选项写入配置文件之外,您还可以通过在每个选项前面加上
    --
    并添加以空格分隔的值,将它们作为选项传递。产生上述输出的最小命令是:

    tidy--indent yes--indent spaces 4--quiet yes--tidy mark no index.html
    
    在某些情况下可能有用

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="UTF-8">
            <title>Document</title>
        </head>
        <body>
            <ul>
                <li>List 1</li>
                <li>List 2</li>
                <li>List 3</li>
                <li>List 4</li>
                <li>List 5</li>
            </ul>
        </body>
    </html>
    
    doctype: html5
    indent: auto
    indent-spaces: 4
    wrap: 0
    tab-size: 4
    quiet: yes
    show-warnings: no
    tidy-mark: no