rouge icon indicating copy to clipboard operation
rouge copied to clipboard

PowerShell subexpressions nested within strings

Open thecityofguanyu opened this issue 3 years ago • 1 comments

Name of the lexer PowerShell

Code sample A sample of the code that produces the bug.

function Write-Log {
    Param(
        $Message,
        $Path = "L:\IISSiteAudit.txt"
    )

    function TS { return "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date) }
    "$(TS) $Message" | Tee-Object -FilePath $Path -Append | Write-Verbose
}

Sample on rouge.jneen.net.

Additional context Specifically, characters after the "$() get mangled as if they're all part of the string -- even after the closing " character.

Originally observed via GitLab 14.3.2. Re-produced locally with Rogue v3.26.1 via rougify,

thecityofguanyu avatar Oct 28 '21 21:10 thecityofguanyu

Has been an annoyance of mine in GitLab for some time and when I saw it still existed in 15.1 I started seeing if it was raised as an issue.

Would very much love to see some movement on this one :)

retryW avatar Sep 05 '22 03:09 retryW