예제 #1
0
        public TextTree(string text)
        {
            var nodeFromText = new TreeBuilder().GetTree(text);

            Tag        = nodeFromText.Tag;
            Children   = nodeFromText.Children;
            IsComplete = nodeFromText.IsComplete;
        }
예제 #2
0
        public string ConvertTextToHtml(string text)
        {
            var treeBuilder = new TreeBuilder();
            var paragraphs  = SplitToParagraphs(text)
                              .Select(x => treeBuilder.GetTree(x))
                              .Select(ConvertTreeToHtml);

            return(String.Join("", paragraphs));
        }
예제 #3
0
            void CompareMarkDownTextAndTree(TextTree expected, string text)
            {
                var actual = new TreeBuilder().GetTree(text);

                CollectionAssert.AreEqual(expected.Children, actual.Children);
            }