Method naming question on OrderedList #30

Closed
opened 2026-01-29 14:21:46 +00:00 by claunia · 4 comments
Owner

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 ReplaceBy or possibly ReplaceWith?

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 `ReplaceBy` or possibly `ReplaceWith`?
claunia added the enhancement label 2026-01-29 14:21:46 +00:00
Author
Owner

@xoofx commented on GitHub (Jun 23, 2016):

Good catch, I removed the method for now as it is not used.

@xoofx commented on GitHub (Jun 23, 2016): Good catch, I removed the method for now as it is not used.
Author
Owner

@thomaslevesque commented on GitHub (Aug 23, 2016):

Good catch, I removed the method for now as it is not used.

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 CodeBlockRenderer with 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 the ObjectRenderers list, 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)

@thomaslevesque commented on GitHub (Aug 23, 2016): > Good catch, I removed the method for now as it is not used. Actually, it _was_ used... by me! As soon as you make something public, you can't assume that it's not used :wink: I just updated to the latest version and realized it was gone. I was using it to replace the `CodeBlockRenderer` with a custom implementation (in order to output Wordpress shortcode tags as described [here](https://en.support.wordpress.com/code/posting-source-code/)). I found a workaround, which is to insert my renderer at the beginning of the `ObjectRenderers` list, 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)
Author
Owner

@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)

@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. :sweat_smile: 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)
Author
Owner

@thomaslevesque 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. 😅

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.

@thomaslevesque 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. :sweat_smile: 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#30