ExportAsHtml

MarkdownSaveOptions.ExportAsHtml property

允许指定要作为原始 HTML 导出到 Markdown 的元素。 默认值为None.

public MarkdownExportAsHtml ExportAsHtml { get; set; }

例子

展示如何将表格作为原始 HTML 导出到 Markdown。

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Writeln("Sample table:");

// 创建表。
builder.InsertCell();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
builder.Write("Cell1");
builder.InsertCell();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Write("Cell2");

MarkdownSaveOptions saveOptions = new MarkdownSaveOptions();
saveOptions.ExportAsHtml = MarkdownExportAsHtml.Tables;

doc.Save(ArtifactsDir + "MarkdownSaveOptions.ExportTableAsHtml.md", saveOptions);

也可以看看