Ejemplo n.º 1
0
 public virtual void Parse(IBlockConverter converter, List <BlockModel> root, BlockModel parent, HtmlNode node)
 {
     foreach (var child in node.ChildNodes)
     {
         converter.ParseNode(root, parent, child);
     }
 }
Ejemplo n.º 2
0
        public virtual void Parse(IBlockConverter converter, List <BlockModel> root, BlockModel parent, HtmlNode node)
        {
            var span = CreateSpan(node);

            if (span != null)
            {
                parent.Children.Add(span);
            }

            foreach (var child in node.ChildNodes)
            {
                converter.ParseNode(root, parent, child);
            }
        }
Ejemplo n.º 3
0
        public virtual void Parse(IBlockConverter converter, List <BlockModel> root, BlockModel parent, HtmlNode node)
        {
            var tempRoot = new List <BlockModel>();

            var block = CreateBlock(node);

            foreach (var child in node.ChildNodes)
            {
                converter.ParseNode(tempRoot, block, child);

                if (tempRoot.Any())
                {
                    if (block.Children.Any())
                    {
                        root.Add(block);
                    }

                    foreach (var innerBlock in tempRoot)
                    {
                        root.Add(innerBlock);
                    }

                    tempRoot = new List <BlockModel>();
                    block    = CreateBlock(node);
                }
            }

            if (block.Children.Any())
            {
                root.Add(block);
            }

            foreach (var innerBlock in tempRoot)
            {
                root.Add(innerBlock);
            }
        }
Ejemplo n.º 4
0
        public virtual void Parse(IBlockConverter builder, List <BlockModel> root, BlockModel parent, HtmlNode node)
        {
            var block = new BlockModel();

            foreach (var child in node.ChildNodes)
            {
                builder.ParseNode(root, block, child);
            }

            foreach (var child in block.Children)
            {
                child.Marks.Add(GetMark(node));
                parent.Children.Add(child);
            }

            parent.MarkDefs.AddRange(block.MarkDefs);

            var markDef = CreateMarkDef(node);

            if (markDef != null)
            {
                parent.MarkDefs.Add(markDef);
            }
        }