mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[Documentation] Support for configure markdown characters #308
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 @RubenMateus on GitHub (Jul 10, 2019).
This is more kinda of question, and my question is if is there any way to configure what characters the markdown associates with html types.
For example: i have a string like "I am crazy" -> toHtml() ->
I am crazy
.Like passing a dictionary of characters to replace for instead of the "regular" markdown
@MihaZupan commented on GitHub (Jul 10, 2019):
By default Markdig will honor the Commonmark specification. Markdown is not the simplest of languages, it is far from a list of substitutions.
A lot of things are configurable, for example if you wanted to always treat
*as bold and_as italic, you can change the function that decides that in the actual renderer (EmphasisInlineRenderer).See the following code for an example. Most of it is what happens if you use the static Markdown.ToHtml() directly.
If you wanted to use a different character to match headings, you can change that like
Some, but not all, things are configurable with simple one-liners, I can help you out with concrete examples.
@RubenMateus commented on GitHub (Jul 10, 2019):
Ok sounds like what i need is kinda doable, let me give you an example.
This is the input:
The output i want from this is:
Is this even possible?
ps: thanks for the help
@MihaZupan commented on GitHub (Jul 10, 2019):
For something like that you'd need to create a new ListItemParser, like
but you'd still have to use spaces after
^and add a new line beforeola.If you wanted the exact behavior you described, you'd have to write your own parser for lists.