-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support LF linebreaks #9
Comments
@fflaten, as a stopgap, you can patch a current installation of the module as follows: In $text = [string]$InputObject
if (Test-Path -LiteralPath $text)
{
$path = Resolve-Path $text
$InputObject = [System.Management.Automation.Language.Parser]::ParseFile($path.ProviderPath, [ref]$null, [ref]$null)
}
else
{
$InputObject = [System.Management.Automation.Language.Parser]::ParseInput($text, [ref]$null, [ref]$null)
} with: $text = [string]$InputObject
if (Test-Path -LiteralPath $text)
{
# To also support LF-only files, read the file in full and normalize the newlines to CRLF,
# which the WinForms textbox control requires for proper display.
$text = (Get-Content -Raw -LiteralPath $text) -replace '(?<!\r)\n', "`r`n"
}
$InputObject = [System.Management.Automation.Language.Parser]::ParseInput($text, [ref]$null, [ref]$null) Given the unknown status of this project (as you know), I'm not submitting a PR. Generally, it would be nice if a cross-platform, console-based re-implementation were to become part of the |
@mklement0 - I just don't have much extra time these days. I should probably just archive the project and hope that someone starts something that works better cross-platform, but I could also consider handing off maintaining this project if someone offered. |
Only recognizes linebreak with CRLF atm.
Should support LF due to more common use with cross-platform scripts.
The text was updated successfully, but these errors were encountered: