Skip to content

fix: ignore props with invalid chars - #298

Merged
farnabaz merged 3 commits into
mainfrom
fix/props-valid-chars
Jul 30, 2026
Merged

fix: ignore props with invalid chars#298
farnabaz merged 3 commits into
mainfrom
fix/props-valid-chars

Conversation

@farnabaz

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

resolves #283

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have run pnpm verify and it passes.
  • I have updated the documentation accordingly.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comark Ready Ready Preview Jul 30, 2026 3:37pm
comark-json-render Ready Ready Preview Jul 30, 2026 3:37pm
comark-nextjs Ready Ready Preview Jul 30, 2026 3:37pm
comark-nuxt Ready Ready Preview Jul 30, 2026 3:37pm
comark-svelte Ready Ready Preview Jul 30, 2026 3:37pm
comark-sveltekit Ready Ready Preview Jul 30, 2026 3:37pm
comark-twoslash Ready Ready Preview Jul 30, 2026 3:37pm
comark-vue Ready Ready Preview Jul 30, 2026 3:37pm

@pkg-pr-new

pkg-pr-new Bot commented Jul 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark

npm i https://pkg.pr.new/comark@298

@comark/angular

npm i https://pkg.pr.new/@comark/angular@298

@comark/ansi

npm i https://pkg.pr.new/@comark/ansi@298

@comark/html

npm i https://pkg.pr.new/@comark/html@298

@comark/nuxt

npm i https://pkg.pr.new/@comark/nuxt@298

@comark/react

npm i https://pkg.pr.new/@comark/react@298

@comark/svelte

npm i https://pkg.pr.new/@comark/svelte@298

@comark/vue

npm i https://pkg.pr.new/@comark/vue@298

commit: e1ddc51

@rock53770

Copy link
Copy Markdown
function isValidAttrName(name) {
  try {
    document.createAttribute(name)
    return true
  } catch {
    return false
  }
}

Is it better to use this as each browser version supports different attributes?

Copy link
Copy Markdown
Collaborator Author

@rock53770 document only exists in browser environment but Comark is agnostic and can be run on any environment.
Also this PR makes sure that attributes only include alphabet, numbers, - and _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Low version browsers such as Chrome 109 may generate errors when setting illegal attribute names

2 participants