Bloom.Book.Book.UpdateTextsNewlyChangedToRequiresParagraph C# (CSharp) Method

UpdateTextsNewlyChangedToRequiresParagraph() public method

public UpdateTextsNewlyChangedToRequiresParagraph ( HtmlDom bookDom ) : void
bookDom HtmlDom
return void
        public void UpdateTextsNewlyChangedToRequiresParagraph(HtmlDom bookDom)
        {
            var texts = OurHtmlDom.SafeSelectNodes("//*[contains(@class,'bloom-requiresParagraphs')]/div[contains(@class,'bloom-editable') and br]");
            foreach (XmlElement text in texts)
            {
                string s = "";
                foreach (var chunk in text.InnerXml.Split(new string[] { "<br />", "<br/>"}, StringSplitOptions.None))
                {
                    if (chunk.Trim().Length > 0)
                        s += "<p>" + chunk + "</p>";
                }
                text.InnerXml = s;
            }
        }
Book