Don't use KiCad escape sequences for JS text.

Fixes https://gitlab.com/kicad/code/kicad/issues/12782
This commit is contained in:
Jeff Young 2022-11-06 15:13:26 +00:00
parent 90c5295a9f
commit 76ce580bd0
1 changed files with 3 additions and 5 deletions

View File

@ -196,19 +196,17 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
}
else if( aContext == CTX_JS_STR )
{
if( c >= 0x7F )
if( c >= 0x7F || c == '\'' || c == '\\' )
{
unsigned int code = c;
char buffer[16];
sprintf( buffer, "\\\\u%4.4X", code );
converted += buffer;
}
else if( c == '\'' )
converted += wxT( "{quote}" );
else if( c == '\\' )
converted += wxT( "{backslash}" );
else
{
converted += c;
}
}
else if( aContext == CTX_LINE )
{