You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note: There is discussion there which is not reproduced here clarifying the needed algorithmic change.
Reproduced here is just the original description of the issue.
if Text("My name is ") followed by Text("Harry") the space following the word "is" will be incorrectly trimmed. Adjacent Text nodes need to be combined before whitespace is removed.
scala> import scala.xml._
import scala.xml._
scala> <div>{Text("My name is ")}{Text("Harry")}</div>
res0: scala.xml.Elem = <div>My name is Harry</div>
scala> Utility.trim(res0)
res1: scala.xml.Node = <div>My name isHarry</div>
This is important when modifying XML and then trimming it. For example we might start with <div>My name is <user:name/></div> and then replace the <user:name/> Elem with "Harry" thus leading to the adjacent Text nodes.