In-reply-to » TIL: There appear to be different whitespace collapsing rules in XML that – at least some of the parsers we used – don’t agree on. Some appear to expect that <a> </a> results in an empty string, others don’t. Well, .trim() it is, I guess.

@movq@www.uninformativ.de Yeah, when I had to do XML back in the days, I also stumbled across this. I might mix things up, but when I looked it up (results are long forgotten, though), there were different rules for XML and HTML. And the behavior also changed with whitespace-only content vs. whitespace pre- and suffixes. Some were kept, others weren’t.

⤋ Read More