diff --git a/framework/h/tag.go b/framework/h/tag.go index 5682e87..86d2d2a 100644 --- a/framework/h/tag.go +++ b/framework/h/tag.go @@ -38,6 +38,14 @@ func TextF(format string, args ...interface{}) *TextContent { return Text(fmt.Sprintf(format, args...)) } +func Details(children ...Ren) *Element { + return Tag("details", children...) +} + +func Summary(children ...Ren) *Element { + return Tag("summary", children...) +} + func Text(text string) *TextContent { return NewTextContent(text) } diff --git a/tools/html-to-htmgo/internal/adapters/services/formatter/indent.go b/tools/html-to-htmgo/internal/adapters/services/formatter/indent.go index f6e9b13..fdffc5f 100644 --- a/tools/html-to-htmgo/internal/adapters/services/formatter/indent.go +++ b/tools/html-to-htmgo/internal/adapters/services/formatter/indent.go @@ -31,11 +31,11 @@ func Indent(input string) string { switch arg.(type) { // If the first argument is another node, add an indent case *ast.CallExpr: - newChildren = append(newChildren, ast.NewIdent("INDENT")) + newChildren = append(newChildren, ast.NewIdent("INDENTME")) } } newChildren = append(newChildren, arg) - newChildren = append(newChildren, ast.NewIdent("INDENT")) + newChildren = append(newChildren, ast.NewIdent("INDENTME")) } n.Args = newChildren return true @@ -51,8 +51,8 @@ func Indent(input string) string { } // Output the formatted code - indented := strings.ReplaceAll(buf.String(), "INDENT,", "\n\t\t") - indented = strings.ReplaceAll(indented, ", INDENT", ", \n\t\t") + indented := strings.ReplaceAll(buf.String(), "INDENTME,", "\n\t\t") + indented = strings.ReplaceAll(indented, ", INDENTME", ", \n\t\t") return indented }