protected virtual StringBuffer Render(IMarkdownRenderer renderer, MarkdownListItemBlockToken token) { var childContent = StringBuffer.Empty; foreach (var item in token.Tokens) { childContent += renderer.Render(item); } return Insert(token, ExposeTokenName(token), childContent); }
protected virtual StringBuffer Render(IMarkdownRenderer renderer, MarkdownListItemBlockToken token) { var childContent = StringBuffer.Empty; foreach (var item in token.Tokens) { childContent += renderer.Render(item); } return(Insert(token, ExposeTokenName(token), childContent)); }
protected StringBuffer Render(IMarkdownRenderer render, MarkdownListItemBlockToken token, string indent, bool last = false) { var content = StringBuffer.Empty; if (token.Tokens.Length > 0) { var tokenRenderContent = StringBuffer.Empty; foreach (var t in token.Tokens) { tokenRenderContent += render.Render(t); } var lines = tokenRenderContent.ToString().Split('\n'); for (var index = 0; index < lines.Count(); index++) { if (last && index == lines.Count() - 1 && string.Equals(lines[index].Trim(), string.Empty)) { continue; } if (!string.Equals(lines[index].Trim(), string.Empty) && index > 0) { content += indent; } content += lines[index]; if (last && index == lines.Count() - 1) { continue; } content += "\n"; } } return(content); }