コード例 #1
0
        protected override void Visit(LiteralChunk chunk)
        {
            if (string.IsNullOrEmpty(chunk.Text))
            {
                return;
            }

            var renderHtml = new RenderHtml
            {
                Html             = chunk.Text,
                DocumentLocation = CreateMappingLocation(chunk.Start, chunk.Association.Length),
            };

            _context.Builder.Add(renderHtml);
        }
コード例 #2
0
        protected override void Visit(ParentLiteralChunk chunk)
        {
            var text = chunk.GetText();

            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            var renderHtml = new RenderHtml
            {
                Html             = text,
                DocumentLocation = CreateMappingLocation(chunk.Start, chunk.Children.Sum(child => child.Association?.Length ?? 0)),
            };

            _context.Builder.Add(renderHtml);
        }