@@ -25,6 +25,7 @@ const (
2525 cosignPointee = `application/vnd.dev.ggcr.magic/cosign-thing+json`
2626 emptyDigest = "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"
2727 hcsshim = `https://github.com/microsoft/hcsshim/blob/main/osversion/windowsbuilds.go`
28+ indent = "\u00a0 \u00a0 " // non-breaking spaces for copyable indentation
2829)
2930
3031type jsonOutputter struct {
@@ -168,7 +169,7 @@ func (w *jsonOutputter) EndMap() {
168169 }
169170 w .pop ()
170171 w .newline ()
171- w .Print ( w .tabs () + "}" )
172+ w .Printf ( "<span class= \" cp \" >%s</span>}" , w .tabs ())
172173 w .key = false
173174 w .name = ""
174175 w .unfresh ()
@@ -188,7 +189,7 @@ func (w *jsonOutputter) EndArray() {
188189 }
189190 w .pop ()
190191 w .newline ()
191- w .Print ( w .tabs () + "]" )
192+ w .Printf ( "<span class= \" cp \" >%s</span>]" , w .tabs ())
192193 w .key = false
193194 w .unfresh ()
194195}
@@ -223,14 +224,13 @@ func (w *jsonOutputter) Fresh() bool {
223224}
224225
225226func (w * jsonOutputter ) push () {
226- w .Print (w . tabs () + `<div class="indent">` + "\n " )
227+ w .Print (`<div class="indent">` + "\n " )
227228 w .fresh = append (w .fresh , true )
228229}
229230
230231func (w * jsonOutputter ) pop () {
231232 w .fresh = w .fresh [:len (w .fresh )- 1 ]
232233 w .newline ()
233- w .Print (w .tabs ())
234234 w .undiv ()
235235}
236236
@@ -280,15 +280,15 @@ func (w *jsonOutputter) maybeMap(k string) string {
280280}
281281
282282func (w * jsonOutputter ) tabs () string {
283- return strings .Repeat (" " , len (w .fresh ))
283+ return strings .Repeat (indent , len (w .fresh ))
284284}
285285
286286func (w * jsonOutputter ) newline () {
287287 w .Print ("\n " )
288288}
289289
290290func (w * jsonOutputter ) div () {
291- w .Print (w .tabs () + "<div >" )
291+ w .Print ("<div><span class= \" cp \" >" + w .tabs () + "</span >" )
292292}
293293
294294func (w * jsonOutputter ) undiv () {
0 commit comments