blakeembrey / blakeembrey/change-case

Don't titlecase HTML entity character references

Open
#348 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
106
PR merge metrics
No merged PRs in 30d

Description

For example, I'm seeing `&` become `&Amp;`, which makes validation fail using my third-party HTML validator.

There is currently no workaround for this issue that I'm aware of because adding in `&` into the `smallWords` parameter doesn't work because line 85 in `index.js` expects an alphanumeric pattern. So you have to put `amp` instead of `&` into the `smallWords` set - which isn't ideal.

![image](https://github.com/user-attachments/assets/2053d7ab-7ad6-4db7-8e69-709a6c11f29e)

Great package by the way.

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in index.js at line 85, where the smallWords parameter is matched against an alphanumeric pattern. Reproduce the example with the HTML entity reference amp; and compare it with the current titlecasing behavior. Done means entity character references are not titlecased, while the existing smallWords behavior remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.