Skip to content

Commit dd7c18b

Browse files
authored
fix(run/markdown-preview): region tags should encompass imports (#1941)
The region tag placement is excluding the import statements, which are very important. Also, unlike the other languages this is hiding that it's wrapped in a function, which the language in the tutorial implies.
1 parent 51cd25f commit dd7c18b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

run/markdown-preview/editor/render.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// [START run_secure_request]
16+
1517
const {GoogleAuth} = require('google-auth-library');
1618
const got = require('got');
1719
const auth = new GoogleAuth();
@@ -21,7 +23,6 @@ let client, serviceUrl;
2123
// renderRequest creates a new HTTP request with IAM ID Token credential.
2224
// This token is automatically handled by private Cloud Run (fully managed) and Cloud Functions.
2325
const renderRequest = async (markdown) => {
24-
// [START run_secure_request]
2526
if (!process.env.EDITOR_UPSTREAM_RENDER_URL) throw Error('EDITOR_UPSTREAM_RENDER_URL needs to be set.');
2627
serviceUrl = process.env.EDITOR_UPSTREAM_RENDER_URL;
2728

@@ -53,7 +54,8 @@ const renderRequest = async (markdown) => {
5354
} catch (err) {
5455
throw Error('request to rendering service failed: ', err);
5556
};
56-
// [END run_secure_request]
5757
};
5858

59+
// [END run_secure_request]
60+
5961
module.exports = renderRequest;

0 commit comments

Comments
 (0)