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

empty safehtml.HTML is true, should be false

Open
#2 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
web-dev

Research direction

Reproduce the playground example and inspect the repository's safehtml.HTML definition and related behavior. Confirm how an empty safehtml.HTML is evaluated in an if, then verify that the zero value behaves like template.HTML("") and the empty string.

Written by the indexing model from the issue text.

Description

bug documentation

There is an incompatibility with html/template. The empty escaped template value template.HTML("") is false an in if, just as the empty string is. But the zero value safehtml.HTML{} is true.

See https://play.golang.org/p/iKB2uBICUX-.

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.