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); }
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); }