我想智能缩进我的 apache2 虚拟主机 conf 文件。我在这里找到了如何智能缩进 xml 文件。但虚拟主机 conf 文件不是有效的 xml 文件。
例如,如果我尝试在 apache2 存储库中给出的 000-default.conf 上使用 xmllint,我会收到一个错误:
$ cat 000-default.conf | xmllint --format -
-:1: parser error : error parsing attribute name
<VirtualHost *:80>
^
-:1: parser error : attributes construct error
<VirtualHost *:80>
^
-:1: parser error : Couldn't find end of Start Tag VirtualHost line 1
<VirtualHost *:80>
^
-:1: parser error : Extra content at the end of the document
<VirtualHost *:80>
^
有没有人知道如何处理这个问题?