mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 13:54:54 +00:00
Make pipeline deep immutable #285
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 @xoofx on GitHub (Apr 5, 2019).
Today, options pushed from a user to parsers but also directly parser instance (which are less directly exposed to users) can be modified during the process of request.
The work on making the markdown pipeline thread/safe immutable was only valid for the list part of the extensions ( #5 ), but is not really valid for some classes that are shared and can be modified during the process of a pipeline.
We need to figure out what we want to do with that.
Likely, we will have to make all these classes immutable - which will require painful constructors...etc.
(See for example comment on PR 327 )
@MihaZupan commented on GitHub (Apr 5, 2019):
An internal
Clone()method could be added to*Optionclasses.For the cases where properties are not collections (only bools, strings), it could be simply implemented as
And then have that be used by the extension like