xoofx / markdig

A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
BSD 2-Clause "Simplified" License
4.35k stars 449 forks source link

[Feature Request] Alternate Variation W/O System.Memory Reference and compat w/AOT/UNITY #512

Closed codiemorgan closed 3 years ago

codiemorgan commented 3 years ago

As per the title, I am wondering if we may get NetStandard2.0 builds of MarkDig which do not reference System.Memory, or a build conditional which could be implemented to allow building from source to allow for builds which exclude optimizations which may rely on System.Memory and System.Buffers?

This is primarily for compatibility within Unity and it's supported platform targets. To get around this, I currently use CommonMark, and intend to use it to to allow markdown formatting of In-game ui elements/quests, etc and to enable support for Markdown Files/Strings within unity's inspectors by translating HTML output into USS/UXML layouts.

System.Memory is an obstacle if we wish to build for WebGL and Mobile Platforms within Unity using NetStandard2.0, but is possible (with additional setup) to use when targeting .NET4.X on standalone (Desktop) platforms.

There are some other limitations which may affect Markdig compatibility with unity's NetStandard2 implementation (below).

My hope is for a variant of Markdig which will function out of the box in when taking the following into account

xoofx commented 3 years ago

As per the title, I am wondering if we may get NetStandard2.0 builds of MarkDig which do not reference System.Memory, or a build conditional which could be implemented to allow building from source to allow for builds which exclude optimizations which may rely on System.Memory and System.Buffers?

We don't want to rollback the work that was done to improve performance, nor we want to maintain special case for older/constrained frameworks.

But you should be able to use this old version 0.18.3 of Markdig which didn't have these dependencies in netstandard 2.0.