Environment-independent method to get the text content of HTML
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Motivation
In #2977, I added a pretty hacky way to get the text content of an HTML string. This was necessary because the method has to work in both browsers and NodeJS and should behave consistently across environments.
Description
Add a method to get the text content of an HTML string. It has to be:
- Safe: No script execution or left-over tags
- Correct: No left-over tags or entities
- Consistent: Same result in all browsers/environments.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the implementation added in issue #2977 and the existing HTML text-content method. Compare its behavior in browsers and NodeJS, focusing on script safety, tag and entity removal, and identical results across environments. Done means the method satisfies all three requirements consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100