@@ -45,12 +45,13 @@ public static XmlDocument GetXmlDomFromHtml(string content, bool includeXmlDecla
4545 content = content . Replace ( "></span>" , ">REMOVEME</span>" ) ;
4646 content = content . Replace ( "></i>" , ">REMOVEME</i>" ) ;
4747
48- // It also likes to insert newlines before <b> and <i>, and convert any existing whitespace
48+ // It also likes to insert newlines before <b>, <u>, and <i>, and convert any existing whitespace
4949 // there to a space.
5050 // It probably does the same to embedded <span> elements, too, so we might need a similar fix
5151 // for those if we start using them in persistent data.
5252 content = content . Replace ( @"<b>" , "REMOVEWHITESPACE<b>" ) ;
5353 content = content . Replace ( @"<i>" , "REMOVEWHITESPACE<i>" ) ;
54+ content = content . Replace ( @"<u>" , "REMOVEWHITESPACE<u>" ) ;
5455
5556 // fix for <br></br> tag doubling
5657 content = content . Replace ( "<br></br>" , "<br />" ) ;
@@ -94,7 +95,7 @@ public static XmlDocument GetXmlDomFromHtml(string content, bool includeXmlDecla
9495
9596 // The regex here is mainly for the \s as a convenient way to remove whatever whitespace TIDY
9697 // has inserted. It's a fringe benefit that we can use the[bi] to deal with both elements in one replace.
97- newContents = Regex . Replace ( newContents , @"REMOVEWHITESPACE\s*\<([bi ])\>" , "<$1>" ) ;
98+ newContents = Regex . Replace ( newContents , @"REMOVEWHITESPACE\s*\<([biu ])\>" , "<$1>" ) ;
9899 dom . LoadXml ( newContents ) ;
99100 }
100101 catch ( Exception e )
0 commit comments