-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Deprecate hey-red/Markdown #19500 #19501
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
Deprecate hey-red/Markdown #19500 #19501
Conversation
- Replace with xoofx/markdig - Update package version in Directory.Packages.props - Update license entry in NOTICES.txt - Update package reference in src\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj - Update src\Umbraco.Core\Composing\TypeFinder.cs - Update src\Umbraco.Infrastructure\HealthChecks\MarkdownToHtmlConverter.cs - Update src\Umbraco.Infrastructure\PropertyEditors\ValueConverters\MarkdownEditorValueConverter.cs
Hi there @gavinfaux, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Perhaps this should be an extension or helper to enable use in other places / packages, just as Articulate uses? using Markdig;
namespace Umbraco.Extensions;
{
public static class MarkdownExtensions
{
private static readonly MarkdownPipeline s_markdownPipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.Build();
public static string ToHtml(string input) => Markdown.ToHtml(input, s_markdownPipeline);
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @gavinfaux - it's a good catch, and I agree we should update this to the supported library. I'd suggest the following things to consider if you are up for some modifications:
- As this is a breaking change and 16 is very close, I think the earliest we can introduce this change would be 17, so please could you re-target to
v17/dev
? - I'm not sure about the extension method suggestion, some people frown on polluting the generic string too much (in the sense that the proposed method will be visible on all strings, not the small fraction of them that contain markdown).
- Rather maybe we should make better use of the existing
IMarkdownToHtmlConverter
? Developers could inject and use that if they needed this service. But that should have some small changes:- It currently lives in a namespace that indicates it's only used for health checks. Likely the interface and implementation should be moved to the namespace
Umbraco.Cms.Core.Strings
Umbraco.Cms.Infrastructure.Strings
respectively (and the files moved on disk to the corresponding folders). - It currently has some code specific for handling the strings found in health check results. I feel they should be removed and put in
EmailNotificationMethod
directly. - We should ourselves inject and use this in
MarkdownEditorValueConverter
rather than referencing the Markdown library directly.
- It currently lives in a namespace that indicates it's only used for health checks. Likely the interface and implementation should be moved to the namespace
Aha! Will close PR and target against |
Prerequisites
If there's an existing issue for this PR then this fixes #19500
Description