"This document has errors" message gets "stuck" after hitting first error, when scanning multiple files
ferdnyc opened this issue · 0 comments
I searched the issues and, though there's been a lot of discussion about message output, it didn't seem as though this exact issue had been reported. Apologies if I just failed to find it.
I'm trying to run tidy
across a set of HTML files, using a config (diff from the defaults below), purely for scanning purposes — no HTML output, just messages.
The problem I'm seeing is that, while the first few files scan with no problems, as soon as tidy
hits the first file with a problem, it starts showing the "This document has errors that must be fixed before using HTML Tidy to generate a tidied up version." message — and then shows it after every file that follows, even the ones with no errors!
As an example of what I mean, assume the html/
directory contains a number of HTML files, and Page5.html
(alone) has an error. This is what I'll see if I run tidy
on that directory:
$ tidy -config ./tidy.conf html/*.html
Tidy: 'html/Page1.html'
Tidy: 'html/Page2.html'
Tidy: 'html/Page3.html'
html/Page3: line 344 column 1 - Warning: <svg> attribute "width" has invalid value "523pt"
html/Page3: line 344 column 1 - Warning: <svg> attribute "height" has invalid value "332pt"
Tidy: 'html/Page4.html'
Tidy: 'html/Page5.html'
html/Page5: line 346 column 15 - Error: <attribute> is not recognized!
html/Page5: line 346 column 15 - Warning: discarding unexpected <attribute>
html/Page5: line 503 column 1 - Warning: <svg> attribute "width" has invalid value "403pt"
html/Page5: line 503 column 1 - Warning: <svg> attribute "height" has invalid value "332pt"
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
Tidy: 'html/Page6.html'
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
Tidy: 'html/Page7.html'
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
Tidy: 'html/Page8.html'
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
Even warnings don't trigger it, but as soon as the first actual error is hit, that message shows up after every other file, even perfectly valid ones.
(And I know they're valid, because:)
$ tidy -config ./tidy.conf html/Page6.html
Tidy: 'html/Page6.html'
$
Tidy version: HTML Tidy for Linux version 5.8.0
Source: Fedora RPM package tidy-5.8.0-7.fc39.x86_64
OS: Fedora Linux 39 x86_64
Tidy config
$ tidy --export-default-config > tidy-default.conf
$ diff -u tidy-default.conf tidy-conf
--- tidy-default.conf 2023-12-08 01:41:02.290681168 -0500
+++ tidy.conf 2023-12-08 01:40:50.344455202 -0500
@@ -1,4 +1,4 @@
-accessibility-check: 0 (Tidy Classic)
+accessibility-check: 0
add-meta-charset: no
add-xml-decl: no
add-xml-space: no
@@ -15,8 +15,8 @@
custom-tags: no
decorate-inferred-ul: no
doctype: auto
-drop-empty-elements: yes
-drop-empty-paras: yes
+drop-empty-elements: no
+drop-empty-paras: no
drop-proprietary-attributes: no
enclose-block-text: no
enclose-text: no
@@ -45,10 +45,10 @@
literal-attributes: no
logical-emphasis: no
lower-literals: yes
-markup: yes
-merge-divs: auto
+markup: no
+merge-divs: no
merge-emphasis: yes
-merge-spans: auto
+merge-spans: no
mute:
mute-id: no
ncr: yes
@@ -65,10 +65,10 @@
output-html: no
output-xhtml: no
output-xml: no
-preserve-entities: no
+preserve-entities: yes
priority-attributes:
punctuation-wrap: no
-quiet: no
+quiet: yes
quote-ampersand: yes
quote-marks: no
quote-nbsp: yes
@@ -76,8 +76,8 @@
replace-color: no
show-body-only: no
show-errors: 6
-show-filename: no
-show-info: yes
+show-filename: yes
+show-info: no
show-meta-change: no
show-warnings: yes
skip-nested: yes
@@ -88,7 +88,7 @@
uppercase-attributes: no
uppercase-tags: no
vertical-space: no
-warn-proprietary-attributes: yes
+warn-proprietary-attributes: no
word-2000: no
wrap: 68
wrap-asp: yes