public virtual StringBuffer Render(IMarkdownRenderer render, DfmYamlHeaderBlockToken token, MarkdownBlockContext context) { StringBuffer content = "---\n"; content += token.Content; content += "\n---\n"; return content; }
public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context) { if (string.IsNullOrEmpty(token.Content)) { return StringBuffer.Empty; } StringBuffer result = "<yamlheader>"; result += StringHelper.HtmlEncode(token.Content); return result + "</yamlheader>"; }
public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context) { if (string.IsNullOrEmpty(token.Content)) { return(StringBuffer.Empty); } StringBuffer result = "<yamlheader>"; result += StringHelper.HtmlEncode(token.Content); return(result + "</yamlheader>"); }
public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context) { if (string.IsNullOrEmpty(token.Content)) { return StringBuffer.Empty; } var startLine = token.SourceInfo.LineNumber; var endLine = startLine + token.Content.Count(ch => ch == '\n') + 2; var sourceFile = token.SourceInfo.File; StringBuffer result = $"<yamlheader start=\"{startLine}\" end=\"{endLine}\""; if (!string.IsNullOrEmpty(sourceFile)) { sourceFile = StringHelper.HtmlEncode(sourceFile); result += $" sourceFile=\"{sourceFile}\""; } result += ">"; result += StringHelper.HtmlEncode(token.Content); return result + "</yamlheader>"; }
public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context) { if (string.IsNullOrEmpty(token.Content)) { return(StringBuffer.Empty); } var startLine = token.SourceInfo.LineNumber; var endLine = token.SourceInfo.LineNumber + token.SourceInfo.ValidLineCount - 1; var sourceFile = token.SourceInfo.File; StringBuffer result = $"<yamlheader start=\"{startLine}\" end=\"{endLine}\""; if (!string.IsNullOrEmpty(sourceFile)) { sourceFile = StringHelper.HtmlEncode(sourceFile); result += $" sourceFile=\"{sourceFile}\""; } result += ">"; result += StringHelper.HtmlEncode(token.Content); return(result + "</yamlheader>"); }
public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context) { return Insert(token, $"{ExposeTokenNameInDfm(token)}>{Escape(token.Content)}"); }
public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context) { return(Insert(token, $"{ExposeTokenNameInDfm(token)}>{Escape(token.Content)}")); }