Skip to content

NullReferenceException in ConvertFrom-Markdown -AsVT100EncodedString with empty alt text #7453

@vors

Description

@vors

Steps to reproduce

ConvertFrom-Markdown '![](https://raw.github.com/junegunn/i/master/fzf.gif)' -AsVT100EncodedString

This is a valid markdown (well any text is valid markdown really, but this one as well)

![](https://raw.github.com/junegunn/i/master/fzf.gif)

It produces the following:

Expected behavior

No error

Actual behavior

ConvertFrom-Markdown : A positional parameter cannot be found that accepts argument '![](https://raw.github.com/junegunn/i/master/fzf.gif)'.
At line:1 char:1
+ ConvertFrom-Markdown '![](https://raw.github.com/junegunn/i/master/fz ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [ConvertFrom-Markdown], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.ConvertFromMarkdownCommand

Stack Trace:

   at Microsoft.PowerShell.MarkdownRender.LinkInlineRenderer.Write(VT100Renderer renderer, LinkInline obj) in /PowerShell/src/Microsoft.PowerShell.MarkdownRender/LinkInlineRenderer.cs:line 22
   at Markdig.Renderers.RendererBase.Write[T](T obj)
   at Markdig.Renderers.RendererBase.WriteChildren(ContainerInline containerInline)
   at Microsoft.PowerShell.MarkdownRender.ParagraphBlockRenderer.Write(VT100Renderer renderer, ParagraphBlock obj) in /PowerShell/src/Microsoft.PowerShell.MarkdownRender/ParagraphBlockRenderer.cs:line 20
   at Markdig.Renderers.RendererBase.Write[T](T obj)
   at Markdig.Renderers.RendererBase.WriteChildren(ContainerBlock containerBlock)
   at Markdig.Renderers.RendererBase.Write[T](T obj)
   at Markdig.Renderers.TextRendererBase.Render(MarkdownObject markdownObject)
   at Microsoft.PowerShell.MarkdownRender.MarkdownConverter.Convert(String markdownString, MarkdownConversionType conversionType, MarkdownOptionInfo optionInfo) in /PowerShell/src/Microsoft.PowerShell.MarkdownRender/MarkdownConverter.cs:line 81
   at Microsoft.PowerShell.Commands.ConvertFromMarkdownCommand.ConvertEachFile(IEnumerable`1 paths, MarkdownConversionType conversionType, Boolean isLiteral, MarkdownOptionInfo optionInfo)
   at Microsoft.PowerShell.Commands.ConvertFromMarkdownCommand.ProcessRecord()
   at System.Management.Automation.Cmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0-preview.4
PSEdition                      Core
GitCommitId                    6.1.0-preview.4
OS                             Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018...
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions