diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 19f5d0725b..73effb2121 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,16 +29,16 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: config-file: ./.github/codeql/codeql-config.yml languages: "javascript" queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: category: "/language:javascript" diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1702934f08..ca1e7aae01 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -73,6 +73,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: sarif_file: results.sarif diff --git a/build/zip-examples.mjs b/build/zip-examples.mjs index 03995efd53..6b2e1e0dac 100644 --- a/build/zip-examples.mjs +++ b/build/zip-examples.mjs @@ -11,6 +11,7 @@ import fs from 'node:fs/promises' import path from 'node:path' import { fileURLToPath } from 'node:url' import sh from 'shelljs' +import { format } from 'prettier' const __dirname = path.dirname(fileURLToPath(import.meta.url)) @@ -83,7 +84,9 @@ for (const file of staticJsFiles) { sh.rm(`${distFolder}/index.html`) // get all examples' HTML files -for (const file of sh.find(`${distFolder}/**/*.html`)) { +const htmlFiles = sh.find(`${distFolder}/**/*.html`) + +const formatPromises = htmlFiles.map(async file => { const fileContents = sh.cat(file) .toString() .replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../') @@ -91,8 +94,24 @@ for (const file of sh.find(`${distFolder}/**/*.html`)) { .replace(/(]*) integrity="[^"]*"/g, '$1') .replace(/]*href="\.\.\/assets\/img\/favicons\/[^"]*"[^>]*>/g, '') .replace(/( -
+
{ - Astro.slots.has('pre') ? ( - - ) : ( -
- -
- ) + nestedInExample + ? (<>) + : Astro.slots.has('pre') + ? ( + + ) + : ( +
+ +
+ ) }
{ diff --git a/site/src/components/shortcodes/Example.astro b/site/src/components/shortcodes/Example.astro index a09fffeb31..044e1af4d4 100644 --- a/site/src/components/shortcodes/Example.astro +++ b/site/src/components/shortcodes/Example.astro @@ -1,6 +1,6 @@ --- import { replacePlaceholdersInHtml } from '@libs/placeholder' -import { Prism } from '@astrojs/prism' +import Code from '@components/shortcodes/Code.astro' interface Props { /** @@ -96,9 +96,7 @@ const simplifiedMarkup = markup
)} -
- -
+ ) }