GoTidy
GoTidy copied to clipboard
Panic - tree has lost its integrity
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.
Wow! That's a doozy! I'll look into this and try and fix this so that it doesn't panic.