PowerShell / platyPS

Write PowerShell External Help in Markdown
MIT License
782 stars 155 forks source link

Fenced code blocks emtpy #716

Open Gijsreyn opened 6 days ago

Gijsreyn commented 6 days ago

Prerequisites

Steps to reproduce

When working on the PnP.PowerShell module, I noticed some of the default fenced code blocks are missing when exporting the result.

Take for example the truncated version of Add-PnPApp.md:

---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Add-PnPApp.html
external help file: PnP.PowerShell.dll-Help.xml
title: Add-PnPApp
---

# Add-PnPApp

## SYNOPSIS
Add/uploads an available app to the app catalog

## SYNTAX

```powershell
Add-PnPApp [-Path] <String> [-Scope <AppCatalogScope>] [-Overwrite] [-Timeout <Int32>] [-Publish [-SkipFeatureDeployment]]
 [-Connection <PnPConnection>] 

# truncated ...

Using the Import-MarkdownCommandHelp and calling the ToMarkdownString() method, removes the code fence.

image

Expected behavior

After export (or ToMarkdownString()), it should have code fenced populated with powershell.

Actual behavior

No code fencing.

Error details

Not applicable

Environment data

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.0.0      preview1   Microsoft.PowerShell.PlatyPS        Desk      {New-MarkdownCommandHelp, Import-MamlHelp, Import-MarkdownCommandHelp, Import-MarkdownModuleFile…}

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response