TidyManaged icon indicating copy to clipboard operation
TidyManaged copied to clipboard

Unable to get diagnostics / ErrorFile

Open troj opened this issue 14 years ago • 1 comments

    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.

troj avatar Aug 18 '11 13:08 troj

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.

freethenation avatar Sep 14 '11 17:09 freethenation