Esempio n. 1
0
        public virtual StringBuffer Render(IMarkdownRenderer render, DfmIncludeBlockToken token, IMarkdownContext context)
        {
            var content = StringBuffer.Empty;

            content += token.Src.NormalizeLink(_filePath, _baseDir);
            content += Constants.Separator;

            return(content);
        }
        public override StringBuffer Render(IMarkdownRenderer render, DfmIncludeBlockToken token, MarkdownBlockContext context)
        {
            var src = token.Src.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);

            if (!string.Equals(src, token.Src))
            {
                return(string.IsNullOrEmpty(token.Title)
                        ? $"[!INCLUDE [{token.Name}]({src})]\n\n"
                        : $"[!INCLUDE [{token.Name}]({src} \"{token.Title}\")]\n\n");
            }

            return(token.SourceInfo.Markdown);
        }
Esempio n. 3
0
 public virtual StringBuffer Render(IMarkdownRenderer render, DfmIncludeBlockToken token, MarkdownBlockContext context)
 {
     return(string.IsNullOrEmpty(token.Title)
             ? $"[!INCLUDE [{token.Name}]({token.Src})]\n"
             : $"[!INCLUDE [{token.Name}]({token.Src} \"{token.Title}\")]\n");
 }