vscode-edge
vscode-edge copied to clipboard
unmatched single quote affects syntax highlighting when using .replace(/'/g, "%27") in @set
Hi,
I was using @set('share_text_encoded', urlEncode(open_graph_title))
to encode strings for later usage in links and this was fine. But I later found that single quotes were not being encoded which broke some other code.
The solution was to use replace(/'/g, "%27")
to explicitly encode the single quotes
@set('share_text_encoded', urlEncode(open_graph_title).replace(/'/g, "%27"))
this is also working just fine BUT it breaks syntax highlighting (presumably because the single quote in the replace
method is unmatched.
The attached gif shows all subsequent text turning green when the line with .replace(/'/g, "%27")
is uncommented