Feature Request: HTML Escaping
- Dominant language
- JavaScript
- Stars
- 5k
- Forks
- 577
- PR merge metrics
- No merged PRs in 30d
Description
Use Case: I've got ~50 code examples in my site, in 6 languages. Those languages native syntax obviously causes Parse Errors with html-minifier because they aren't escaped. I've been escaping them, but it has become unmanageable and really tough to run/update these code samples. While there are solutions that I've been looking in to, I think a solution could be built into html-minifier:
```
options: {
escapeFragments: [ /
[\S\s]*<\/code><\/pre>/ ]
}
```
alternatively (though less preferable):
```
```
I tried solving this using `ignoreCustomFragments`, which made the build pass, but browsers render this incorrectly when you use code that resembles html open/close tags such as `Map batchMap = new HashMap();`
It seems like there's been enough issues posted about html entities that I'm not the only one that would benefit from a built in solution: #446 #195 #282
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.