Skip to content

Commit 40da2e1

Browse files
authored
Update config for xmllint at xml-check.php (#91)
The XML files in the docs are using 1 space for indentation, so setting the ``XMLLINT_INDENT= ' '`` environment variable and the ``--format`` option for ``xmllint`` ensuring the right indentation makes sense to me. Regarding the encoding, some files are using UTF-8, others utf-8. See: https://gnome.pages.gitlab.gnome.org/libxml2/xmllint.html
1 parent 140b2f6 commit 40da2e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/xml-check.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
fwrite($fp, $file);
4444
fclose($fp);
4545

46-
passthru("$xmllint --noent --noout --valid $example_filename 2> $example_filename.out"); // xmllint outputs to stderr which is not catched by shell_exec, 2> &1 doesn't work on Windows
46+
passthru("XMLLINT_INDENT=' ' $xmllint --noent --noout --encode UTF-8 --format --valid $example_filename 2> $example_filename.out"); // xmllint outputs to stderr which is not catched by shell_exec, 2> &1 doesn't work on Windows
4747
$errors = file_get_contents("$example_filename.out");
4848
$errors = preg_replace("~.*validity error : IDREF attribute linkend references an unknown ID.*\n.*\n.*\n~", "", $errors);
4949
$errors = str_replace($example_filename, $_SERVER["argv"][1], $errors);

0 commit comments

Comments
 (0)