diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-09-10 20:19:26 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-09-10 20:20:00 +0200 |
commit | adb23b20e8d2f360e9b20499bff10734890810ac (patch) | |
tree | 916aba7b040755d1e5cab033049f55e037ccf1b1 /formatter | |
parent | 7eac3c24255a86257d42ab38668cbd88dc96f55b (diff) |
Remove all XML support
Diffstat (limited to 'formatter')
-rw-r--r-- | formatter/formatter.go | 24 |
1 files changed, 2 insertions, 22 deletions
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("</%s>", ast.Text) } @@ -86,18 +78,6 @@ func printAttrs(attrs []parser.Attr) { } } -func printDocType(node parser.AstNode) { - if parser.Xml { - fmt.Print("<?xml") - printAttrs(node.Attrs) - fmt.Print("?>") - } else { - fmt.Print("<!DOCTYPE") - printAttrs(node.Attrs) - fmt.Print(">") - } -} - func printText(s string) { for _, r := range s { if v, ok := stringEscapes[r]; ok { |