Skip to content

Commit

Permalink
made tidy.go print attributes as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bytbox committed Aug 23, 2010
1 parent 5ba679a commit b06cf80
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tidy.go
Expand Up @@ -34,6 +34,11 @@ func Tidy(str string) (html string, err os.Error) {
elem := token.(xml.StartElement)
for i := 0; i < indent; i++ { html += indentation }
html += "<"+String(elem.Name)
for _, attr := range elem.Attr {
html += fmt.Sprintf(" %s=\"%s\"",
String(attr.Name),
attr.Value)
}
html += ">\n"
indent++
case xml.EndElement:
Expand Down

0 comments on commit b06cf80

Please sign in to comment.