public TextTree(string text) { var nodeFromText = new TreeBuilder().GetTree(text); Tag = nodeFromText.Tag; Children = nodeFromText.Children; IsComplete = nodeFromText.IsComplete; }
public string ConvertTextToHtml(string text) { var treeBuilder = new TreeBuilder(); var paragraphs = SplitToParagraphs(text) .Select(x => treeBuilder.GetTree(x)) .Select(ConvertTreeToHtml); return(String.Join("", paragraphs)); }
void CompareMarkDownTextAndTree(TextTree expected, string text) { var actual = new TreeBuilder().GetTree(text); CollectionAssert.AreEqual(expected.Children, actual.Children); }