Open Geek-Bob opened 7 months ago
Things like tables aren't enabled by default. You must opt-in by adding additional extensions, e.g. UseAdvancedExtensions
.
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.Build();
string html = Markdown.ToHtml(content, pipeline);
Markdig won't add CSS for you -- styling is left up to you.
Sorry, I pasted the wrong code earlier, I was trying to convert Markdown to FlowDocument. My original code is:
FlowDocument flowDocument =new Markdown().Transform(str);
But then I read your source code and found a solution, as follows:
var Engine = new Markdown();
var plugins = MdXamlPlugins.Default.Clone();
plugins.Syntax.And(SyntaxManager.MdXaml);
Engine.Plugins = plugins;
Engine.DocumentStyle = MarkdownStyle.Standard;
FlowDocument flowDocument = Engine.Transform(str);
I wonder if this is a reasonable solution
code
Problem description
For example: font title size, font background color, table border, table line background color, code block
Normal style
[markdig] Style rendering