mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 21:37:02 +00:00
Method naming question on OrderedList #30
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 @billbogaiv on GitHub (Jun 23, 2016).
Ref. https://github.com/lunet-io/markdig/blob/v0.5.11/src/Markdig/Helpers/OrderedList.cs#L105
Should this be
ReplaceByor possiblyReplaceWith?@xoofx commented on GitHub (Jun 23, 2016):
Good catch, I removed the method for now as it is not used.
@thomaslevesque commented on GitHub (Aug 23, 2016):
Actually, it was used... by me! As soon as you make something public, you can't assume that it's not used 😉
I just updated to the latest version and realized it was gone. I was using it to replace the
CodeBlockRendererwith a custom implementation (in order to output Wordpress shortcode tags as described here). I found a workaround, which is to insert my renderer at the beginning of theObjectRendererslist, but I don't know if it's the proper way to do it... (I also tried to replace the existing renderer, but it threw a NRE afterwards during the rendering)@xoofx commented on GitHub (Aug 23, 2016):
Ah sorry, I meant not used internally... as markdig is still in 0.x this kind of breaking change can happen. 😅
I would be fine to reintroduce this method (but instead of checking is only, ReplaceBy would work on an exact match of types == typeof(T)), you can send a PR if you have time (as I'm moving, I'm not yet in a position to work correctly for 1-2 weeks)
@thomaslevesque commented on GitHub (Aug 23, 2016):
Oh, it's totally fine, I understand that breaking changes can happen at any time. I don't really need
ReplaceBy, if there's another way to achieve the same result. I was just wondering if my approach (inserting a custom renderer at the beginning of the list) was how you intended the library to be used.