Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get diagnostics / ErrorFile #4

Open
troj opened this issue Aug 18, 2011 · 1 comment
Open

Unable to get diagnostics / ErrorFile #4

troj opened this issue Aug 18, 2011 · 1 comment

Comments

@troj
Copy link

troj commented Aug 18, 2011

    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.

@freethenation
Copy link

My fork at https://github.com/freethenation/TidyManaged has this feature.

commit 2dc8105:
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants