示例#1
0
 public virtual StringBuffer Render(IMarkdownRenderer render, DfmYamlHeaderBlockToken token, MarkdownBlockContext context)
 {
     StringBuffer content = "---\n";
     content += token.Content;
     content += "\n---\n";
     return content;
 }
示例#2
0
 public virtual StringBuffer Render(IMarkdownRenderer render, DfmYamlHeaderBlockToken token, MarkdownBlockContext context)
 {
     StringBuffer content = "---\n";
     content += token.Content;
     content += "\n---\n";
     return content;
 }
示例#3
0
 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>";
 }
示例#4
0
        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>");
        }
示例#5
0
        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>";
        }
示例#6
0
        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>");
        }
示例#7
0
 public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context)
 {
     return Insert(token, $"{ExposeTokenNameInDfm(token)}>{Escape(token.Content)}");
 }
示例#8
0
 public virtual StringBuffer Render(IMarkdownRenderer renderer, DfmYamlHeaderBlockToken token, MarkdownBlockContext context)
 {
     return(Insert(token, $"{ExposeTokenNameInDfm(token)}>{Escape(token.Content)}"));
 }