Exemple #1
0
func TidyBytes(src []byte) []byte {
	td := C.tidyCreate()
	C.tidyParseString(td, (*C.tmbchar)(unsafe.Pointer(&src[0])))
	C.tidyCleanAndRepair(td)
	var blen C.unsigned
	C.tidySaveString(td, nil, &blen)
	buf := make([]byte, int(blen))
	C.tidySaveString(td, (*C.tmbchar)(unsafe.Pointer(&buf[0])), &blen)
	return buf
}
Exemple #2
0
func New() *Tidy {
	t := &Tidy{}
	t.tdoc = C.tidyCreate()
	return t
}