aboutsummaryrefslogtreecommitdiff
path: root/formatter
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-01 16:38:49 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-01 16:38:49 +0100
commit1f83fa89d8585b1fa59df7a400157f8df93ff681 (patch)
treedc80afa3ea2f17f76705e7a4b695f41386320845 /formatter
parenteced3e62c922ee121429759eaa5d4956eb17085d (diff)
Remove the ‘>’ prefixv3.0.0
The rationale was explained on the mailing list[1]. [1]: https://paste.thomasvoss.com/353
Diffstat (limited to 'formatter')
-rw-r--r--formatter/formatter.go4
-rw-r--r--formatter/formatter_test.go14
2 files changed, 5 insertions, 13 deletions
diff --git a/formatter/formatter.go b/formatter/formatter.go
index 8bd1c4d..526de5a 100644
--- a/formatter/formatter.go
+++ b/formatter/formatter.go
@@ -35,10 +35,6 @@ func PrintAst(ast parser.AstNode) {
printChildren(ast.Children)
fmt.Printf("</%s>", ast.Text)
}
-
- if ast.Newline {
- fmt.Print("\n")
- }
case parser.Tagless:
printChildren(ast.Children)
case parser.TaglessTrim:
diff --git a/formatter/formatter_test.go b/formatter/formatter_test.go
index c5f0b83..4fe8035 100644
--- a/formatter/formatter_test.go
+++ b/formatter/formatter_test.go
@@ -35,14 +35,14 @@ func restoreAndCapture() string {
func TestPrintAst(t *testing.T) {
s := `
html lang="en" {
- >head attr {
- >title {-
+ head attr {
+ title {-
My Website
}
meta .→{} x="y"{}
}
- >body {
- >div #some-id {}
+ body {
+ div #some-id {}
div key="val" .class-1 .class-2 {
p {- This is some @em{-emphatic} text }
}
@@ -52,11 +52,7 @@ func TestPrintAst(t *testing.T) {
}`
result := `<html lang="en"><head attr><title>
My Website
- </title>
-<meta class="→{}" x="y"></head>
-<body><div id="some-id">
-<div class="class-1 class-2" key="val"><p> This is some <em>emphatic</em> text </p></div><tags key="Some long value"></body>
-</html>`
+ </title><meta class="→{}" x="y"></head><body><div id="some-id"><div class="class-1 class-2" key="val"><p> This is some <em>emphatic</em> text </p></div><tags key="Some long value"></body></html>`
// Write the source to a temp file
r := strings.NewReader(s)