mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Utility method for replacing built-in object renderer #103
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 @Daniel15 on GitHub (Mar 19, 2017).
Hello! I'm trying to use Markdig to replace MarkdownDeep. Currently I pre-process GitHub-style code fences via a regular expression, as MarkdownDeep does not support them natively. I'd like to remove this as Markdig is nice and supports code fences out-of-the-box, which is awesome. However, I want to output some different HTML to support my current configuration using highlight.js.
Currently I'm doing something like this to replace the built-in CodeBlockRenderer with my own one
This works, but it seems a bit verbose. It would be nice to have a
ReplaceWithutility method so I could do something like:I guess I could just have an extension method for this though. Just an idea :)
Thanks for the awesome project!
@Daniel15 commented on GitHub (Mar 19, 2017):
This is the extension method I wrote, seems to be working fine so far:
Usage:
@xoofx commented on GitHub (Mar 19, 2017):
It makes sense. Feel free to open a PR for OrderedList.cs
@Daniel15 commented on GitHub (Mar 19, 2017):
Thanks, I'll do that soon! :)
@xoofx commented on GitHub (Mar 19, 2017):
Note that I have reverted back the changes related to VS2017 on master. Make sure to use the latest
@Daniel15 commented on GitHub (Mar 19, 2017):
Submitted as #103