Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

PowerShell: backslash is not an escape character in a double quoted string #458

Open
HumanEquivalentUnit opened this issue Oct 27, 2016 · 3 comments

Comments

@HumanEquivalentUnit
Copy link

Backslash is not an escape character in a PowerShell string, but Prettify thinks it is.

A string like "D:\SplittedFunction\" is fine, but Prettify cannot tell that it has ended. This breaks highlighting for all the following code, which is coloured as if it was a string literal. e.g. http://stackoverflow.com/a/40267174/478656 shows the problem.

(The escape character is a backtick; see also: about_Quoting_Rules and about_Escape_Characters).

@amroamroamro
Copy link
Contributor

amroamroamro commented Dec 11, 2016

FYI, there is no specific language handler for Powershell, it is being highlighted by the default language handler, which assumes a C-like syntax.

Here is a live version to play with: https://jsfiddle.net/amroamroamro/y8evj55g/

@JohnLBevan
Copy link

There's a request for PowerShell support in #295 .
Suggest closing this ticket / tracking progress under the above.

@Halkcyon
Copy link

@HumanEquivalentUnit Backslash is considered an escape character in special cases, like if you turn off the parser i.e. --% when calling external cli tools

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants