MarkdownExportAsHtml

MarkdownExportAsHtml enumeration

允许指定要作为原始 HTML 导出到 Markdown 的元素。

[Flags]
public enum MarkdownExportAsHtml

价值观

姓名价值描述
None0使用 Markdown 语法导出所有元素,无需任何原始 HTML。
Tables1将表格导出为原始 HTML。

例子

展示如何将表格作为原始 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);

也可以看看