New-UDMarkdown not rendering as expected?

New-UDMarkdown not rendering as expected?

avatar
(anonymous user)
Product: PowerShell Universal
Version: 3.9.13


i have the following code block and it doesn’t look like it’s doing a carriage return as i expect:

New-UDGrid -Container -Children {
    New-UDGrid -Item -ExtraSmallSize 8 -Children {
        New-UDPaper -Elevation 2 -Children {
            New-UDMarkdown -Markdown "# Server Lifecycle Management

            Hello Wizards, welcome to the new lifecycle management app!
            "
        }
    }
}


and this is how it renders:


e89f0d9edc513de974431c82532e75bdc1262811
am i missing something? thought i knew how to markdown lol.

TIA

e89f0d9edc513de974431c82532e75bdc1262811.png

All Comments (3)

avatar

Seems like this behavior occurs in UDPaper only and looks as expected with it removed. was trying to be crafty with aesthetics as i like the paper component.

avatar

What happens if you put your markdown in a .md file and use the code:

New-UDHtml -Markup (ConvertFrom-Markdown -path "/Path/To/File.md").Html


Plan C could be just to use:

New-UDHeading -Size 1 -Text "Server Lifecycle Management"
New-UDParagraph -Text "Hello Wizards, welcome to the new lifecycle management app!"


I suspect multi-lining may be your problem there.

avatar

You can fix this by overriding the display type:

        New-UDPaper -Elevation 2 -Children {
            New-UDMarkdown -Markdown "# Server Lifecycle Management

            Hello Wizards, welcome to the new lifecycle management app!
            "
        } -Style @{
           display = "block" 
       }


Adam Driscoll
PowerShell Expert and Developer at Devolutions