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

NodeModelToMamlModel\ failing with two examples in Markdown file #597

Closed
3 tasks done
ewhitchu opened this issue Apr 13, 2023 · 3 comments
Closed
3 tasks done

NodeModelToMamlModel\ failing with two examples in Markdown file #597

ewhitchu opened this issue Apr 13, 2023 · 3 comments
Labels
platyps-0.14.2 Resolution-By Design The reported behavior is by design.

Comments

@ewhitchu
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Using a clone of PlatyPS 2.0.0 Preview1 which I need to modify for some local requirements.

New-ExternalHelp function throws an error on the very first function in the Module I have developed.

Is this likely to be fixed? Have you any suggestions how I can fix it myself?

Extract from markdown file

EXAMPLES

EXAMPLE 1

Convert-Size -Size 568956
555 KB

Description

Converts the byte value 568956 to upper most value of 555 KB

EXAMPLE 2

Get-ChildItem  | ? {! $_.PSIsContainer} | Select -First 5 | Select Name, @{L='Size';E={$_ | Convert-Size}}
Name                                                           Size
----                                                           ----
Data1.cap                                                      14.4 MB
Data2.cap                                                      12.5 MB

Image.iso                                                      5.72 GB
Index.txt                                                      23.9 KB
SomeSite.lnk                                                   1.52 KB
SomeFile.ini                                                   152 bytes

Description

Used with Get-ChildItem and custom formatting with Select-Object to list the uppermost size.

Expected behavior

Expected XML to be generated correctly

Actual behavior

Error is thrown:
.
.
.VERBOSE: Importing function 'Update-DllsFromJsonConfig'.
ForEach-Object: Exception calling "NodeModelToMamlModel" with "1" argument(s):
"E:\DevForF5\F5MWPIandM\PowerShell\Modules\FMWPOperation\FMWPClientMntce\out\FMWPClientMntce\2.1.0\Docs\Convert-Size.md:24:(158) '  ###
EXAMPLE 2 '  Expect Heading level 2"
PS E:\DevForF5\devtools\scripts>

The Errors.json file shows:

[
  {
    "Severity": "Error",
    "FilePath": "",
    "Message": "Exception calling \"NodeModelToMamlModel\" with \"1\" argument(s): \"E:\\DevForF5\\F5MWPIandM\\PowerShell\\Modules\\FMWPOperation\\FMWPClientMntce\\out\\FMWPClientMntce\\2.1.0\\Docs\\Convert-Size.md:24:(158) '\r\n\r\n### EXAMPLE 2\r\n'\n Expect Heading level 2\".Exception.Message"
  }
]

Error details

see above

Environment data

PowerShell 7.3.3
PS C:\Users\ewhit> E:
PS E:\> cd DevForF5\devtools
PS E:\DevForF5\devtools> Get-Module F5PlatyPS -ListAvailable

    Directory: C:\Program Files\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     2.1.0                 F5platyPS                           Desk      {New-F5MarkdownHelp, Get-F5MarkdownMetadata, New-F5External…

PS E:\DevForF5\devtools>

PS E:\DevForF5\devtools> $PSVersionTable

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

PS E:\DevForF5\devtools>

Visuals

Using a clone of PlatyPS 2.0.0 Preview1 which I need to modify for some local requirements.

New-External Help

@ewhitchu ewhitchu added the Needs-Triage The issue is new and needs to be triaged by a work group. label Apr 13, 2023
@ewhitchu
Copy link
Author

I had updated both the Markdown.MAML and PlatyPS projects to use latest releases of all dependencies, and re-built the solution.

@ewhitchu
Copy link
Author

Same issue when using Version 0.14.2 in a clean system

@sdwheeler sdwheeler added platyps-0.14.2 and removed Needs-Triage The issue is new and needs to be triaged by a work group. labels May 21, 2024
@sdwheeler
Copy link
Collaborator

You have the following text in your markdown:

Description
-----------
Converts the byte value 568956 to upper most value of 555 KB

The dashed line is seen as an H2 Header. PlatyPS throws an error because when it gets and H2 header it expects it to be

## PARAMETERS

This is an expected error.

@sdwheeler sdwheeler added the Resolution-By Design The reported behavior is by design. label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platyps-0.14.2 Resolution-By Design The reported behavior is by design.
Projects
None yet
Development

No branches or pull requests

2 participants