@@ -52,7 +52,7 @@ func formatJSON(data interface{}, indent int) string {
5252
5353 // Process each key-value pair in the object
5454 for key , value := range v {
55- if key != "type" && key != "content" {
55+ if key != "text" && key != " type" && key != "content" {
5656 // sb.WriteString(indentStr)
5757 sb .WriteString (key )
5858 sb .WriteString (": " )
@@ -62,13 +62,11 @@ func formatJSON(data interface{}, indent int) string {
6262 switch val := value .(type ) {
6363 case map [string ]interface {}, []interface {}:
6464 // For nested objects and arrays, add newline and format with increased indent
65- sb .WriteString ("\n " )
6665 sb .WriteString (formatJSON (val , indent + 1 ))
6766 default :
6867 // For primitive values, format inline
6968 if val != "text" {
7069 sb .WriteString (fmt .Sprintf ("%v" , val ))
71- sb .WriteString ("\n " )
7270 }
7371 }
7472 }
@@ -87,12 +85,10 @@ func formatJSON(data interface{}, indent int) string {
8785 switch val := item .(type ) {
8886 case map [string ]interface {}, []interface {}:
8987 // For nested objects and arrays, add newline and format with increased indent
90- sb .WriteString ("\n " )
9188 sb .WriteString (formatJSON (val , indent + 1 ))
9289 default :
9390 // For primitive values, format inline
9491 sb .WriteString (fmt .Sprintf ("%v" , val ))
95- sb .WriteString ("\n " )
9692 }
9793 }
9894 default :
0 commit comments