From 05afb949a65eacb3dfc774de59d31ea912ae5959 Mon Sep 17 00:00:00 2001 From: mikouaji Date: Fri, 30 Jan 2026 18:46:06 +0100 Subject: [PATCH 1/3] fix: add missing whitespace before `import` keyword in code previews --- server/utils/code-highlight.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/server/utils/code-highlight.ts b/server/utils/code-highlight.ts index 84d6a254b8..0a762eaab7 100644 --- a/server/utils/code-highlight.ts +++ b/server/utils/code-highlight.ts @@ -220,11 +220,20 @@ function linkifyImports(html: string, options?: LinkifyOptions): string { // or: import('module' // Note: require often has a leading space in the span from Shiki result = result.replace( - /(]*>)\s*(require|import)(<\/span>)(]*>\(<\/span>)(]*>)(['"][^'"]+['"])<\/span>/g, - (match, spanOpen, keyword, spanClose, parenSpan, stringSpanOpen, moduleSpecifier) => { + /(]*>)(\s*)(require|import)(<\/span>)(]*>\(<\/span>)(]*>)(['"][^'"]+['"])<\/span>/g, + ( + match, + spanOpen, + whitespace, + keyword, + spanClose, + parenSpan, + stringSpanOpen, + moduleSpecifier, + ) => { const href = getHref(moduleSpecifier) if (!href) return match - return `${spanOpen}${keyword}${spanClose}${parenSpan}${stringSpanOpen}${moduleSpecifier}` + return `${spanOpen}${whitespace}${keyword}${spanClose}${parenSpan}${stringSpanOpen}${moduleSpecifier}` }, ) From 3c492b3513c94adfa7aa89b92bd8853328aa6f7a Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:49:11 +0000 Subject: [PATCH 2/3] [autofix.ci] apply automated fixes --- lunaria/files/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lunaria/files/en-US.json b/lunaria/files/en-US.json index 8a6cc33a5a..e0ba7476e0 100644 --- a/lunaria/files/en-US.json +++ b/lunaria/files/en-US.json @@ -329,7 +329,7 @@ "size": "Size", "deps": "Deps", "updated": "Updated", - "install": "Install", + "get_started": "Get started", "readme": "Readme", "maintainers": "Maintainers", "keywords": "Keywords", From 6a9d7a2b416a7107c2e3f881531a27350a9f71dd Mon Sep 17 00:00:00 2001 From: mikouaji Date: Fri, 30 Jan 2026 21:35:22 +0100 Subject: [PATCH 3/3] fix: bump cache version --- server/api/registry/file/[...pkg].get.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/registry/file/[...pkg].get.ts b/server/api/registry/file/[...pkg].get.ts index b133e0f69d..c1dd76c1b3 100644 --- a/server/api/registry/file/[...pkg].get.ts +++ b/server/api/registry/file/[...pkg].get.ts @@ -6,7 +6,7 @@ import { ERROR_PACKAGE_VERSION_AND_FILE_FAILED, } from '#shared/utils/constants' -const CACHE_VERSION = 2 +const CACHE_VERSION = 3 // Maximum file size to fetch and highlight (500KB) const MAX_FILE_SIZE = 500 * 1024