GoTidy icon indicating copy to clipboard operation
GoTidy copied to clipboard

Panic - tree has lost its integrity

Open vmihailenco opened this issue 11 years ago • 1 comments

I am getting

Panic - tree has lost its integrity

when run following program:

package main

import (
    "fmt"
    "log"

    "github.com/JalfResi/GoTidy"
)

func main() {
    t := tidy.New()
    defer t.Free()

    t.InputXml(true)
    t.OutputXml(true)
    t.AddXmlDecl(true) // Without this option everything is OK.

    output, err := t.Tidy("test")
    if err != nil {
        log.Fatal(err, output)
    }
    fmt.Println(output)
}

I guess this is libtidy issue, but probably you can change Go program to not exit when libtidy can't parse XML.

vmihailenco avatar May 23 '13 10:05 vmihailenco

Wow! That's a doozy! I'll look into this and try and fix this so that it doesn't panic.

JalfResi avatar May 23 '13 13:05 JalfResi