本文整理汇总了C#中MarkdownDeep.Markdown.HtmlEncode方法的典型用法代码示例。如果您正苦于以下问题:C# Markdown.HtmlEncode方法的具体用法?C# Markdown.HtmlEncode怎么用?C# Markdown.HtmlEncode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarkdownDeep.Markdown
的用法示例。
在下文中一共展示了Markdown.HtmlEncode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
//.........这里部分代码省略.........
break;
case BlockType.dt:
{
if (children == null)
{
foreach (var l in Content.Split('\n'))
{
b.Append("<dt>");
m.SpanFormatter.Format(b, l.Trim());
b.Append("</dt>\n");
}
}
else
{
b.Append("<dt>\n");
RenderChildren(m, b);
b.Append("</dt>\n");
}
break;
}
case BlockType.dl:
b.Append("<dl>\n");
RenderChildren(m, b);
b.Append("</dl>\n");
return;
case BlockType.html:
b.Append(buf, contentStart, contentLen);
return;
case BlockType.unsafe_html:
m.HtmlEncode(b, buf, contentStart, contentLen);
return;
case BlockType.codeblock:
if(m.FormatCodeBlock == null)
{
var dataArgument = this.data as string ?? string.Empty;
string tagSuffix = "</code></pre>\n\n";
if(m.GitHubCodeBlocks && !string.IsNullOrWhiteSpace(dataArgument))
{
if(dataArgument == "nohighlight")
{
b.Append("<pre class=\"nocode\">");
tagSuffix = "</pre>";
}
else
{
b.AppendFormat("<pre><code class=\"{0}\">", dataArgument);
}
}
else
{
b.Append("<pre><code>");
}
foreach(var line in children)
{
m.HtmlEncodeAndConvertTabsToSpaces(b, line.buf, line.contentStart, line.contentLen);
b.Append("\n");
}
b.Append(tagSuffix);
}
else
示例2: Render
//.........这里部分代码省略.........
break;
case BlockType.dt:
{
if (children == null)
{
foreach (var l in Content.Split('\n'))
{
b.Append("<dt>");
m.SpanFormatter.Format(b, l.Trim());
b.Append("</dt>\n");
}
}
else
{
b.Append("<dt>\n");
RenderChildren(m, b);
b.Append("</dt>\n");
}
break;
}
case BlockType.dl:
b.Append("<dl>\n");
RenderChildren(m, b);
b.Append("</dl>\n");
return;
case BlockType.html:
b.Append(buf, contentStart, contentLen);
return;
case BlockType.unsafe_html:
m.HtmlEncode(b, buf, contentStart, contentLen);
return;
case BlockType.codeblock:
RenderCodeBlock(m, b);
return;
case BlockType.quote:
b.Append("<blockquote>\n");
RenderChildren(m, b);
b.Append("</blockquote>\n");
return;
case BlockType.li:
b.Append("<li>\n");
RenderChildren(m, b);
b.Append("</li>\n");
return;
case BlockType.ol:
b.Append("<ol>\n");
RenderChildren(m, b);
b.Append("</ol>\n");
return;
case BlockType.ul:
b.Append("<ul>\n");
RenderChildren(m, b);
b.Append("</ul>\n");
return;
case BlockType.HtmlTag:
var tag = (HtmlTag)data;
示例3: Render
//.........这里部分代码省略.........
break;
case BlockType.dt:
{
if (Children == null)
{
foreach (var l in Content.Split('\n'))
{
b.Append("<dt>");
m.SpanFormatter.Format(b, l.Trim());
b.Append("</dt>\n");
}
}
else
{
b.Append("<dt>\n");
RenderChildren(m, b);
b.Append("</dt>\n");
}
break;
}
case BlockType.dl:
b.Append("<dl>\n");
RenderChildren(m, b);
b.Append("</dl>\n");
return;
case BlockType.html:
b.Append(Buf, ContentStart, ContentLen);
return;
case BlockType.unsafe_html:
m.HtmlEncode(b, Buf, ContentStart, ContentLen);
return;
case BlockType.codeblock:
if(m.FormatCodeBlockFunc == null)
{
var dataArgument = this.Data as string ?? string.Empty;
string tagSuffix = "</code></pre>\n\n";
if(m.GitHubCodeBlocks && !string.IsNullOrWhiteSpace(dataArgument))
{
if(dataArgument == "nohighlight")
{
b.Append("<pre class=\"nocode\">");
tagSuffix = "</pre>";
}
else
{
b.AppendFormat("<pre><code class=\"{0}\">", dataArgument);
}
}
else
{
b.Append("<pre><code>");
}
foreach(var line in Children)
{
m.HtmlEncodeAndConvertTabsToSpaces(b, line.Buf, line.ContentStart, line.ContentLen);
b.Append("\n");
}
b.Append(tagSuffix);
}
else