Skip to content
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

Out-HtmlView doesn't show line breaks #473

Open
agrajaghh opened this issue Feb 18, 2025 · 1 comment
Open

Out-HtmlView doesn't show line breaks #473

agrajaghh opened this issue Feb 18, 2025 · 1 comment

Comments

@agrajaghh
Copy link

agrajaghh commented Feb 18, 2025

Unfortunately Out-HtmlView doesn't show line breaks (`n) without carriage return (`r) for me. Powershell and Out-GridView are showing the normal line breaks:

Example Code:

$test = @("1. new line`ninline",
          "2. new line`r`ninline with carriage return",
          "3. new line`n",
          "4. two new lines`n`n")
$test | Out-HtmlView
$test | Out-GridView
$test | Write-Host

Out-HtmlView Output in Firefox:
Image

Out-GridView Output:
Image

Write-Host Output:

1. new line
inline
2. new line
inline with carriage return
3. new line

4. two new lines


System Info:
Windows 11
Powershell 7.4.6
PSWriteHTML 1.28.0

@PrzemyslawKlys
Copy link
Member

Ye I guess one would have to fix this to be consistent.

$test = @("1. new line`ninline",
    "2. new line`r`ninline with carriage return",
    "3. new line`n",
    "4. two new lines`n`n")
$test | Out-HtmlView -FilePath $PSScriptRoot\test.html -Online -DataStore JavaScript
$test | Out-GridView
#$test | Write-Host

$test1 = @("1. new line$([System.Environment]::NewLine)inline",
    "2. new line$([System.Environment]::NewLine)inline with carriage return",
    "3. new line$([System.Environment]::NewLine)",
    "4. two new lines$([System.Environment]::NewLine)")

New-HTML {
    New-HTMLTable -DataTable $test -DataStore JavaScript
    New-HTMLTable -DataTable $test1 -DataStore JavaScript

    New-HTMLTable -DataTable $test -DataStore HTML
    New-HTMLTable -DataTable $test1 -DataStore HTML
} -ShowHTML

https://github.com/EvotecIT/PSWriteHTML/blob/8e0a2ee5f7d23aec60b9c5bcfb42933b703f21cb/Private/New-DefaultSettings.ps1#L33-L42

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

No branches or pull requests

2 participants