]*)\s+style="[^"]*"/, ']*) style="[^"]*"/, ' in text content (e.g., arrow functions =>)
// We need to encode them for HTML validation
return escapeRawGt(html)
diff --git a/shared/schemas/package.ts b/shared/schemas/package.ts
index 355b138d9..7bfde5db3 100644
--- a/shared/schemas/package.ts
+++ b/shared/schemas/package.ts
@@ -22,7 +22,7 @@ export const PackageNameSchema = v.pipe(
export const VersionSchema = v.pipe(
v.string(),
v.nonEmpty('Version is required'),
- v.regex(/^[a-z0-9._+-]+$/i, 'Invalid version format'),
+ v.regex(/^[\w.+-]+$/, 'Invalid version format'),
)
/**
diff --git a/shared/utils/git-providers.ts b/shared/utils/git-providers.ts
index 0f9760861..e14e82f5f 100644
--- a/shared/utils/git-providers.ts
+++ b/shared/utils/git-providers.ts
@@ -299,7 +299,7 @@ export function normalizeGitUrl(input: string): string | null {
const normalized = raw.replace(/^git\+/, '')
// Handle ssh:// and git:// URLs by converting to https://
- if (/^(ssh|git):\/\//i.test(normalized)) {
+ if (/^(?:ssh|git):\/\//i.test(normalized)) {
try {
const url = new URL(normalized)
const path = url.pathname.replace(/^\/*/, '')
diff --git a/shared/utils/npm.ts b/shared/utils/npm.ts
index ae918a6c4..54fb00730 100644
--- a/shared/utils/npm.ts
+++ b/shared/utils/npm.ts
@@ -2,7 +2,7 @@ import { getLatestVersion } from 'fast-npm-meta'
import { createError } from 'h3'
import validatePackageName from 'validate-npm-package-name'
-const NPM_USERNAME_RE = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/i
+const NPM_USERNAME_RE = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i
const NPM_USERNAME_MAX_LENGTH = 50
/**
diff --git a/shared/utils/parse-basic-frontmatter.ts b/shared/utils/parse-basic-frontmatter.ts
index 21bba954c..a2c31187f 100644
--- a/shared/utils/parse-basic-frontmatter.ts
+++ b/shared/utils/parse-basic-frontmatter.ts
@@ -1,5 +1,5 @@
export function parseBasicFrontmatter(fileContent: string): Record {
- const match = fileContent.match(/^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/)
+ const match = fileContent.match(/^---[ \t]*\n([\s\S]*?)\n---[ \t]*(?:\n|$)/)
if (!match?.[1]) return {}
return match[1].split('\n').reduce>((acc, line) => {
From 45aa48c98d4e8a4c99907af70136ec9a1f853864 Mon Sep 17 00:00:00 2001
From: btea <2356281422@qq.com>
Date: Sat, 7 Feb 2026 11:40:57 +0800
Subject: [PATCH 2/4] chore: knip update
---
knip.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/knip.ts b/knip.ts
index d066b592a..6b7901476 100644
--- a/knip.ts
+++ b/knip.ts
@@ -42,6 +42,7 @@ const config: KnipConfig = {
/** Oxlint plugins don't get picked up yet */
'@e18e/eslint-plugin',
+ 'eslint-plugin-regexp',
],
ignoreUnresolved: ['#components', '#oauth/config'],
},
From aaf487242ebee9085f30fd3ab28234a54d381dbe Mon Sep 17 00:00:00 2001
From: btea <2356281422@qq.com>
Date: Sat, 7 Feb 2026 12:03:43 +0800
Subject: [PATCH 3/4] chore: update
---
server/utils/docs/text.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/utils/docs/text.ts b/server/utils/docs/text.ts
index 28e0a5362..f168399cb 100644
--- a/server/utils/docs/text.ts
+++ b/server/utils/docs/text.ts
@@ -1,3 +1,4 @@
+/* oxlint-disable regexp/no-super-linear-backtracking */
/**
* Text Processing Utilities
*
@@ -69,8 +70,7 @@ export function createSymbolId(kind: string, name: string): string {
*/
export function parseJsDocLinks(text: string, symbolLookup: SymbolLookup): string {
let result = escapeHtml(text)
-
- result = result.replace(/\{@link\s+([^\s}]+)(?:\s+([^\s}]*))?\}/g, (_, target, label) => {
+ result = result.replace(/\{@link\s+([^\s}]+)(?:\s+([^}]+))?\}/g, (_, target, label) => {
const displayText = label || target
// External URL
@@ -105,7 +105,7 @@ export async function renderMarkdown(text: string, symbolLookup: SymbolLookup):
// - \r\n, \n, or \r line endings
const codeBlockData: Array<{ lang: string; code: string }> = []
let result = text.replace(
- /```[ \t]*(\w*)(?:\r\n|\r|\n)([\s\S]*?)(?:\r\n|\r|\n)?```/g,
+ /```[ \t]*(\w*)[ \t]*(?:\r\n|\r|\n)([\s\S]*?)(?:\r\n|\r|\n)?```/g,
(_, lang, code) => {
const index = codeBlockData.length
codeBlockData.push({ lang: lang || 'text', code: code.trim() })
From 137aa981ba42f4d678a5bd511d1b78ef901afcfd Mon Sep 17 00:00:00 2001
From: btea <2356281422@qq.com>
Date: Sat, 7 Feb 2026 12:07:47 +0800
Subject: [PATCH 4/4] chore: revert unnecessary change
---
server/utils/docs/text.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/server/utils/docs/text.ts b/server/utils/docs/text.ts
index f168399cb..7cb574903 100644
--- a/server/utils/docs/text.ts
+++ b/server/utils/docs/text.ts
@@ -70,6 +70,7 @@ export function createSymbolId(kind: string, name: string): string {
*/
export function parseJsDocLinks(text: string, symbolLookup: SymbolLookup): string {
let result = escapeHtml(text)
+
result = result.replace(/\{@link\s+([^\s}]+)(?:\s+([^}]+))?\}/g, (_, target, label) => {
const displayText = label || target