-
Notifications
You must be signed in to change notification settings - Fork 20
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
Microsoft.PowerShell.MarkdownRender.MarkdownInfo.ToString() should be the HTML #28
Comments
While I think it's a good idea to have Thus, it's probably better to do something like [operand order updated after feedback]: public override string ToString() {
return this.Html ?? this.VT100EncodedString ?? string.Empty;
} |
@mklement0 I'm definitely open to the idea of a flag, as I think both are useful. However / and, I think that should be the job of a local formatter (which should probably call Show-Markdown) I think HTML construction is the more common / intended use case and should be the default. I also think ToString() could have multiple overloads ;-) |
It is the default, but the problem is that Defaulting to whichever property is filled in to me seems like the preferable behavior. As for multiple overloads: That would be useful in the abstract - say From what I can tell, while you can currently publicly instantiate a |
@mklement0 I get what you're saying here, and I think the best approach would be to make the |
…Shell#28 ) If HTML is not present, it should be or VT100EncodedString.
PR updated. Thanks for the feedback! |
Summary of the new feature / enhancement
As a user, I want to be able to more seamlessly work with Markdown in PowerShell.
Unfortunately, when I try to ToString() a Markdown object, I get:
Microsoft.PowerShell.MarkdownRender.MarkdownInfo
This makes easily embedding markdown inside of a string more painful than it needs to be, and also complicates logic for -joining multiple markdowns
Proposed technical implementation details (optional)
The
.ToString()
method the MarkdownInfo class should be the converted HTML.The text was updated successfully, but these errors were encountered: