Stefan Greve 55e9ec7a7a Add IsAotCompatible for net8.0 and later targets (#963)
* Add IsAotCompatible for net8.0 and later targets

* Enable the trim, AOT and single-file analyzers in Markdig's own build, so
  CI catches an AOT regression before it ships to consumers
* Limit the property to net8.0+, since the analyzers do not run on
  netstandard and net462 targets
* Test the assembly metadata, asserting IsAotCompatible only on net10.0,
  because the ILLink 8 build tasks used for net8.0 emit just IsTrimmable

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Fix test by verifying the AOT marking with an IL3058 build check

* Replace the assembly metadata unit tests, which failed in the netstandard
  workflow because it builds Markdig for netstandard2.x only
* Add Markdig.AotTests with VerifyReferenceAotCompatibility and IL3058 as an
  error, so the CI solution build fails if Markdig loses the AOT marking
* Leave PublishAot unset, so the check restores no package beyond the
  ILLink.Tasks package the IsAotCompatible property already requires

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 20:56:50 +02:00
2022-04-23 17:37:06 +02:00
2025-10-16 17:24:33 +02:00
2025-10-16 17:24:33 +02:00
2026-02-21 09:52:46 +01:00
2022-10-18 08:47:11 +02:00

Markdig ci Coverage Status NuGet

Markdig is a fast, powerful, CommonMark compliant, extensible Markdown processor for .NET.

Documentation: https://xoofx.github.io/markdig

You can try Markdig online and compare it to other implementations on babelmark3

Features

If you are looking for support for an old .NET Framework 3.5 or 4.0, you can download Markdig 0.18.3.

Third Party Extensions

Documentation

Full documentation is available at https://xoofx.github.io/markdig — covering getting started, usage, all extensions, and the developer guide for writing custom parsers and renderers.

For detailed specs and corner cases of each extension, see the specs documentation.

For a "behind the scene" article about Markdig, see the blog post "Implementing a Markdown Engine for .NET".

Download

Markdig is available as a NuGet package: NuGet

Also Markdig.Signed NuGet package provides signed assemblies.

Usage

The main entry point for the API is the Markdig.Markdown class:

By default, without any options, Markdig is using the plain CommonMark parser:

var result = Markdown.ToHtml("This is a text with some *emphasis*");
Console.WriteLine(result);   // prints: <p>This is a text with some <em>emphasis</em></p>

In order to activate most of all advanced extensions (except Emoji, SoftLine as HardLine, Bootstrap, YAML Front Matter, JiraLinks and SmartyPants)

// Configure the pipeline with all advanced extensions active
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
var result = Markdown.ToHtml("This is a text with some *emphasis*", pipeline);

Try it online!

You can have a look at the MarkdownExtensions that describes all actionable extensions (by modifying the MarkdownPipeline)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. For detailed contributing guidelines, please see contributing.md.

Build

In order to build Markdig, you need to install .NET 10.0

License

This software is released under the BSD-Clause 2 license.

Sponsors

Supports this project with a monthly donation and help me continue improving it. [Become a sponsor]

lilith Lilith River, author of Imageflow Server, an easy on-demand image editing, optimization, and delivery server

Credits

Thanks to the fantastic work done by John Mac Farlane for the CommonMark specs and all the people involved in making Markdown a better standard!

This project would not have been possible without this huge foundation.

Thanks also to the project BenchmarkDotNet that makes benchmarking so easy to setup!

Some decoding part (e.g HTML EntityHelper.cs) have been re-used from CommonMark.NET

Thanks to the work done by @clarkd on the JIRA Link extension, now included with this project!

Author

Alexandre MUTEL aka xoofx

Description
No description provided
Readme 9.1 MiB
Latest
2026-02-10 06:11:01 +00:00
Languages
C# 99.9%