TidyManaged
TidyManaged copied to clipboard
Unable to get diagnostics / ErrorFile
Using doc As Document = Document.FromString(input.Text.Trim())
doc.ShowWarnings = True
doc.Quiet = False
doc.OutputBodyOnly = AutoBool.Yes
doc.ErrorFile = "tidy.txt"
doc.CleanAndRepair()
output.Text = doc.Save()
End Using
When I run this code, the file tidy.txt never gets created. What I'm really after is to use TidyManaged to provide my users with the ability to validate their HTML, and fix it (or accept what HTMLTidy generates), but I need them to see any markup errors in what they've created.
Thus, the ideal would be to get the diagnostic information returned as a String, but I can read it from a file, if need be.
My fork at https://github.com/freethenation/TidyManaged has this feature.
commit 2dc8105f11bdb7cb24df27562dc95f8af711b6e2: Modified CleanAndRepair to return a string containing libtidy's error log. Libtidy used to write its error log to standard out. Also added an overloaded of CleanAndRepair that allows the error log to be written to a stream.