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