Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

safe identifier characters should include all Unicode alphanumerics

Open
#4 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
security

Research direction

Start in identifier.go at onlyAlphanumericsOrHyphenPattern, using the issue's Unicode character classes as the proposed scope. Check the existing identifier validation behavior and consider the stated security concern before changing it. Done means safe identifiers accept Unicode letters and numbers while retaining hyphen and underscore support.

Written by the indexing model from the issue text.

Description

The documentation for safe identifiers says "alphanumeric" characters are allowed, but the implementation supports only ASCII letters and numbers. Unless there are security issues with Unicode characters, they should be supported.

Motivation: documentation sites that want to use language identifiers as (part of) fragments for easy navigation, e.g. https://pkg.go.dev.

The change I'm suggesting would be from

var onlyAlphanumericsOrHyphenPattern = regexp.MustCompile(`^[-_a-zA-Z0-9]*$`)

(https://github.com/google/safehtml/blob/v0.0.2/identifier.go#L49)
to

var onlyAlphanumericsOrHyphenPattern = regexp.MustCompile(`^[-_\pL\pN]*$`)
Dominant language
Go
Stars
380
Forks
23
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/safehtml

All issues in google/safehtml

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.