From adb23b20e8d2f360e9b20499bff10734890810ac Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 10 Sep 2023 20:19:26 +0200 Subject: Remove all XML support --- formatter/formatter.go | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'formatter') diff --git a/formatter/formatter.go b/formatter/formatter.go index 6524747..25ecafc 100644 --- a/formatter/formatter.go +++ b/formatter/formatter.go @@ -27,20 +27,12 @@ func PrintAst(ast parser.AstNode) { switch ast.Type { case parser.Text: printText(ast.Text) - case parser.DocType: - printDocType(ast) case parser.Normal: fmt.Printf("<%s", ast.Text) printAttrs(ast.Attrs) + fmt.Print(">") - if len(ast.Children) == 0 { - if parser.Xml { - fmt.Print("/>") - } else { - fmt.Print(">") - } - } else { - fmt.Print(">") + if len(ast.Children) > 0 { printChildren(ast.Children) fmt.Printf("", ast.Text) } @@ -86,18 +78,6 @@ func printAttrs(attrs []parser.Attr) { } } -func printDocType(node parser.AstNode) { - if parser.Xml { - fmt.Print("") - } else { - fmt.Print("") - } -} - func printText(s string) { for _, r := range s { if v, ok := stringEscapes[r]; ok { -- cgit v1.2.3