Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure we escape sequences of different entities
In a naive, multi-pass entity replacement (eg, replace all `&` with `&`, replace all `<` with `<`) the replacement order is important. (You must replace `&` with `&` first, lest you replace `<` with `<` then replace `<` with `&lt;`.) The `escapeHTML` function is a single-pass replacement of each entity at a time, so is not vulnerable to such a failure mode, but add a test to avoid regressions.
- Loading branch information