|
|
@ -5,6 +5,7 @@ import (
|
|
|
|
"code.google.com/p/go.net/html/atom"
|
|
|
|
"code.google.com/p/go.net/html/atom"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"github.com/fatih/color"
|
|
|
|
"github.com/fatih/color"
|
|
|
|
|
|
|
|
"github.com/mattn/go-colorable"
|
|
|
|
"regexp"
|
|
|
|
"regexp"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -21,6 +22,10 @@ var (
|
|
|
|
postWhitespace = regexp.MustCompile(`\s+$`)
|
|
|
|
postWhitespace = regexp.MustCompile(`\s+$`)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
|
|
color.Output = colorable.NewColorableStdout()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func printIndent(level int) {
|
|
|
|
func printIndent(level int) {
|
|
|
|
for ; level > 0; level-- {
|
|
|
|
for ; level > 0; level-- {
|
|
|
|
fmt.Print(indentString)
|
|
|
|
fmt.Print(indentString)
|
|
|
|