Bloom.Publish.EpubMaker.RemoveSpuriousLinks C# (CSharp) Method

RemoveSpuriousLinks() private method

Clean up any dangling pointers and similar spurious data.
private RemoveSpuriousLinks ( HtmlDom pageDom ) : void
pageDom Bloom.Book.HtmlDom
return void
        private void RemoveSpuriousLinks(HtmlDom pageDom)
        {
            // The validator has complained about area-describedby where the id is not found.
            // I don't think we will do qtips at all in books so let's just remove these altogether for now.
            foreach (XmlElement elt in pageDom.RawDom.SafeSelectNodes("//*[@aria-describedby]"))
            {
                elt.RemoveAttribute("aria-describedby");
            }

            // Validator doesn't like empty lang attributes, and they don't convey anything useful, so remove.
            foreach (XmlElement elt in pageDom.RawDom.SafeSelectNodes("//*[@lang='']"))
            {
                elt.RemoveAttribute("lang");
            }
            // Validator doesn't like '*' as value of lang attributes, and they don't convey anything useful, so remove.
            foreach (XmlElement elt in pageDom.RawDom.SafeSelectNodes("//*[@lang='*']"))
            {
                elt.RemoveAttribute("lang");
            }
        }