Escape quotes when emitting React
This commit is contained in:
Родитель
0d95d0405c
Коммит
d229ae4be5
|
@ -6848,7 +6848,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
if (isLineBreak(c)) {
|
||||
if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) {
|
||||
let part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1);
|
||||
result = (result ? result + "\" + ' ' + \"" : "") + part;
|
||||
result = (result ? result + "\" + ' ' + \"" : "") + escapeString(part);
|
||||
}
|
||||
firstNonWhitespace = -1;
|
||||
}
|
||||
|
@ -6862,7 +6862,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
|
||||
if (firstNonWhitespace !== -1) {
|
||||
let part = text.substr(firstNonWhitespace);
|
||||
result = (result ? result + "\" + ' ' + \"" : "") + part;
|
||||
result = (result ? result + "\" + ' ' + \"" : "") + escapeString(part);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
|
|
|
@ -19,7 +19,11 @@ namespace M {
|
|||
// and M.React.__spread
|
||||
var foo;
|
||||
var spread1 = <div x='' {...foo} y='' />;
|
||||
|
||||
// Quotes
|
||||
var x = <div>This "quote" thing</div>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// [file.js]
|
||||
|
@ -33,4 +37,6 @@ var M;
|
|||
// and M.React.__spread
|
||||
var foo;
|
||||
var spread1 = M.React.createElement("div", M.React.__spread({x: ''}, foo, {y: ''}));
|
||||
// Quotes
|
||||
var x = M.React.createElement("div", null, "This \"quote\" thing");
|
||||
})(M || (M = {}));
|
||||
|
|
|
@ -36,5 +36,12 @@ namespace M {
|
|||
>x : Symbol(unknown)
|
||||
>foo : Symbol(foo, Decl(react-consumer.tsx, 7, 4))
|
||||
>y : Symbol(unknown)
|
||||
|
||||
// Quotes
|
||||
var x = <div>This "quote" thing</div>;
|
||||
>x : Symbol(x, Decl(react-consumer.tsx, 11, 4))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 2, 22))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 2, 22))
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,5 +37,13 @@ namespace M {
|
|||
>x : any
|
||||
>foo : any
|
||||
>y : any
|
||||
|
||||
// Quotes
|
||||
var x = <div>This "quote" thing</div>;
|
||||
>x : JSX.Element
|
||||
><div>This "quote" thing</div> : JSX.Element
|
||||
>div : any
|
||||
>div : any
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,4 +19,8 @@ namespace M {
|
|||
// and M.React.__spread
|
||||
var foo;
|
||||
var spread1 = <div x='' {...foo} y='' />;
|
||||
|
||||
// Quotes
|
||||
var x = <div>This "quote" thing</div>;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче