mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Escape quotes when emitting React
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user