mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Escape quotes when they appear as HTML entities in JSX text
Fixes #6241
This commit is contained in:
1 parent
72bb1d3dec
commit
e12855bca0
5 files changed
+15
-1
No files matched your search
@@ -7221,7 +7221,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
// Replace entities like
|
||||
result = result.replace(/&(\w+);/g, function(s: any, m: string) {
|
||||
if (entities[m] !== undefined) {
|
||||
return String.fromCharCode(entities[m]);
|
||||
let ch = String.fromCharCode(entities[m]);
|
||||
// " needs to be escaped
|
||||
return ch === '"' ? '\\"' : ch;
|
||||
}
|
||||
else {
|
||||
return s;
|
||||
|
||||
Reference in new issue
Block a user