public StringBuilder AppendHtml(StringBuilder stringBuilder, PageContentProjection projection)
        {
            var content = projection.GetHtml(htmlHelper);

            var childrenContents = projection.GetChildProjections() ?? new List<ChildContentProjection>();
            var parsedWidgets = ParseWidgetsFromHtml(content).Distinct();
            
            var availableWidgets = childrenContents.Where(cc => parsedWidgets.Any(id => id.AssignmentIdentifier == cc.AssignmentIdentifier));
            foreach (var childProjection in availableWidgets)
            {
                var model = parsedWidgets.First(w => w.AssignmentIdentifier == childProjection.AssignmentIdentifier);
                var replaceWhat = model.Match.Value;
                var replaceWith = AppendHtml(new StringBuilder(), childProjection).ToString();

                content = content.Replace(replaceWhat, replaceWith);
            }
            
            // Widgets, which has no access (e.g. widgets with draft status for public users)
            var invisibleWidgets = parsedWidgets.Where(id => childrenContents.All(cc => cc.AssignmentIdentifier != id.AssignmentIdentifier));
            foreach (var model in invisibleWidgets)
            {
                var replaceWhat = model.Match.Value;
                var replaceWith = string.Empty;

                content = content.Replace(replaceWhat, replaceWith);

            }

            stringBuilder.Append(content);

            return stringBuilder;
        }
        /// <summary>
        /// Appends the HTML with HTML, rendered by content projection.
        /// </summary>
        /// <param name="stringBuilder">The string builder.</param>
        /// <param name="projection">The projection.</param>
        /// <param name="pageModel">The page model.</param>
        /// <returns></returns>
        public StringBuilder AppendHtml(StringBuilder stringBuilder, PageContentProjection projection, RenderPageViewModel pageModel)
        {
            var renderingPageModel = pageModel.RenderingPage ?? pageModel;
            var content = projection.GetHtml(htmlHelper);
            if (!renderingPageModel.RenderedPageContents.Contains(projection.PageContentId))
            {
                renderingPageModel.RenderedPageContents.Add(projection.PageContentId);
            }

            var childrenContents = projection.GetChildProjections() ?? new List<ChildContentProjection>();
            var parsedWidgets = ParseWidgetsFromHtml(content).Distinct();

            var availableWidgets = childrenContents.Where(cc => parsedWidgets.Any(id => id.AssignmentIdentifier == cc.AssignmentIdentifier));
            foreach (var childProjection in availableWidgets)
            {
                var model = parsedWidgets.First(w => w.AssignmentIdentifier == childProjection.AssignmentIdentifier);
                var replaceWhat = model.Match.Value;
                var replaceWith = AppendHtml(new StringBuilder(), childProjection, renderingPageModel).ToString();

                content = content.Replace(replaceWhat, replaceWith);
            }

            // Widgets, which has no access (e.g. widgets with draft status for public users)
            var invisibleWidgets = parsedWidgets.Where(id => childrenContents.All(cc => cc.AssignmentIdentifier != id.AssignmentIdentifier));
            foreach (var model in invisibleWidgets)
            {
                var replaceWhat = model.Match.Value;
                var replaceWith = string.Empty;

                content = content.Replace(replaceWhat, replaceWith);

            }

            // Add child contents in the master page to child region is possible only if content is widget.
            // If content is regular HTML content, it works as master page contents, and contents may be added only in the child page
            // If page is for preview, doesn't rendering children regions
            if ((!renderingPageModel.IsMasterPage || projection.Content is IChildRegionContainer) && !pageModel.IsPreviewing)
            {
                content = AppendHtmlWithChildRegionContens(content, projection, renderingPageModel);
            }

            stringBuilder.Append(content);

            return stringBuilder;
        }