Skip to content

Commit 9b8a803

Browse files
aneesasclaude
andcommitted
Upgrade Astro to 7.3.5 to fix Sharp/libheif RCE advisory
Astro < 7.2.8 bundles a Sharp (0.34.x) whose libheif can be exploited via a malicious AVIF image. There is no 5.x backport, so upgrade to Astro 7, which pulls in sharp 0.35.5. Astro 7 follow-ups: - Node 20 -> 22 in the Dockerfile and deploy workflow (Astro 7 needs >= 22.12) - Add @astrojs/markdown-remark and pass remark plugins via unified() - Set compressHTML: true to keep Astro 5's whitespace handling - Drop the missing owl.video.play.png reference and IE star hacks, which the new Vite/LightningCSS pipeline rejects Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 70b1743 commit 9b8a803

7 files changed

Lines changed: 2551 additions & 932 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- uses: actions/setup-node@v4
2929
with:
30-
node-version: 20
30+
node-version: 22
3131
cache: npm
3232

3333
- run: npm ci

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Single image used for both local dev (astro dev) and producing the static
22
# build (astro build). Node lives only in here — the host needs just Docker.
3-
FROM node:20-alpine
3+
FROM node:22-alpine
44

55
WORKDIR /app
66

‎astro.config.mjs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
3+
import { unified } from '@astrojs/markdown-remark';
34
import remarkSmartypants from 'remark-smartypants';
45
import remarkImageParagraphs from './src/lib/remark-image-paragraphs.ts';
56
import remarkReferences from './src/lib/remark-references.ts';
@@ -9,6 +10,9 @@ import remarkReferences from './src/lib/remark-references.ts';
910
export default defineConfig({
1011
site: 'https://acl.mit.edu',
1112
trailingSlash: 'ignore',
13+
// Astro 7 defaults to JSX whitespace rules, which drop the spaces between
14+
// inline elements that the templates rely on; keep the lossless compression.
15+
compressHTML: true,
1216
build: {
1317
// Keep the old site's URLs: `people/index.astro` -> /people/index.html,
1418
// `people/[kerberos].astro` -> /people/<kerberos>.html (served at /people/<kerberos>).
@@ -17,8 +21,10 @@ export default defineConfig({
1721
markdown: {
1822
// Typographic quotes and dashes as on the old (kramdown) site: `--` is an
1923
// en dash, `---` an em dash.
20-
smartypants: false,
21-
remarkPlugins: [[/** @type {any} */ (remarkSmartypants), { dashes: 'oldschool' }], remarkReferences, remarkImageParagraphs],
24+
processor: unified({
25+
smartypants: false,
26+
remarkPlugins: [[/** @type {any} */ (remarkSmartypants), { dashes: 'oldschool' }], remarkReferences, remarkImageParagraphs],
27+
}),
2228
syntaxHighlight: 'shiki',
2329
shikiConfig: { theme: 'github-light' },
2430
},

0 commit comments

Comments
 (0)