Beispiel #1
0
        protected void SetArticleText(FeedItem item, HtmlNodeCollection nodes)
        {
            System.Diagnostics.Debug.Assert(item != null, "item is null, but must not!");
            if (nodes == null)
            {
                return;
            }

            // The following line of code
            //  - sort nodes by their position in the HTML document,
            //  - grabs inner text and
            //  - joins it to a big string containing the whole article body
            String content = String.Join("\n", nodes.OrderBy(n => n.StreamPosition).Select(n => n.InnerText));

            // Sanitize article text
            content = SanitizeText(content);

            item.Content = content;
        }