_content/js: fix typing blank line at bottom of playground in Safari

I don't understand why this is necessary, but empirically, it fixes the problem.

Fixes golang/go#49794.

Change-Id: I1258d26d1540a178b864d373038e297c14e8e6ff
Reviewed-on: https://go-review.googlesource.com/c/website/+/367975
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/_content/js/playground.js b/_content/js/playground.js
index 441f1eb..6f02e59 100644
--- a/_content/js/playground.js
+++ b/_content/js/playground.js
@@ -293,7 +293,11 @@
 
     // autoindent helpers.
     function insertTabs(n) {
-      document.execCommand('insertText', false, '\t'.repeat(n));
+      // Without the n > 0 check, Safari cannot type a blank line at the bottom of a playground snippet.
+      // See go.dev/issue/49794.
+      if (n > 0) {
+        document.execCommand('insertText', false, '\t'.repeat(n));
+      }
     }
     function autoindent(el) {
       var curpos = el.selectionStart;