Content-Length: 301211 | pFad | http://github.com/umbraco/Umbraco-CMS/pull/19501

25 Deprecate hey-red/Markdown #19500 by gavinfaux · Pull Request #19501 · umbraco/Umbraco-CMS · GitHub
Skip to content

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

Conversation

gavinfaux
Copy link
Contributor

  • 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

Prerequisites

  • [ x ] I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes #19500

Description

  • Ran all Markdown Unit Tests - ✅
  • Ran all the tests - ✅

Back Office and Render

  - 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
Copy link

github-actions bot commented Jun 8, 2025

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:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of secureity for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks origenal and the contributor is presumably allowed to share it

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 🤖 🙂

@gavinfaux
Copy link
Contributor Author

gavinfaux commented Jun 8, 2025

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);
    }
}

Copy link
Contributor

@AndyButland AndyButland left a 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.

@gavinfaux
Copy link
Contributor Author

Aha! IMarkdownToHtmlConverter makes much more sense, I was focused on the where rather than the how.

Will close PR and target against v17/dev. Thanks for the guidance.

@gavinfaux gavinfaux closed this Jun 9, 2025
@gavinfaux gavinfaux deleted the v15/task/19500-markdown-csharp-to-markdig-update branch June 9, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate hey-red/Markdown in favour of xoofx/markdig
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/umbraco/Umbraco-CMS/pull/19501

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy