internal/godoc/internal/doc: factor out part of playExample
internal/godoc/internal/doc: factor out part of playExample

Just to make the function shorter.

Change-Id: I6982e1a2d7438f68b82b47c8066891d3b2c608ea
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/285813
Trust: Jonathan Amsterdam <e3d3698b2ccd5955e4adf250d0785062d0f9018b@google.com>
Run-TryBot: Jonathan Amsterdam <e3d3698b2ccd5955e4adf250d0785062d0f9018b@google.com>
Reviewed-by: Julie Qiu <8d32267b6b4884cf35adeaccde2b6857ae11aace@golang.org>

golang/pkgsite,golang/pkgsite,golang/pkgsite,golang/pkgsite