mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 13:54:54 +00:00
[Feature Request] Alternate Variation W/O System.Memory Reference and compat w/AOT/UNITY #435
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @codiemorgan on GitHub (Feb 12, 2021).
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
Targeting .NetStandard2/NET461 within Unity (manual create and edit csc.rsp, not guaranteed for all platforms)
Net4.X: Minimum target is 4.6.1, maximum is a limited subset up to 4.7.
NetStandard: Only 2.0 is supported currently.
IL2CPP / AOT Platforms (with code stripping) - when using NetStandard2 while targeting WebGL
IL2CPP / AOT Platforms when targeting IOS/Android from within Unity (threading is possible).
Android: System.IO functionality is limited (UnityWebRequest required to
downloadfrom persistant data to a temp file before System.IO can be used to load a file)(WebAssembly) WebGL, everything in System.Threading and System.Threading.Tasks is unusable
(WebAssembly) WebGL, all file operations and streams are unusable, UnityWebRequest for IO or Session/Cookies.
(NetStandard2) System.Buffers unusable within Unity on all platforms
(NetStandard2) System.Memory - depends on System.Buffers.
(NetStandard2) System.Text.Json unusable within Unity on all platforms
Other .Net assemblies require csc.rsp file edits by hand.
@xoofx commented on GitHub (Feb 12, 2021):
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.