]*)\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) => {