News for hackers. Stuff that matters.
Re:The poor, misunderstood innerText by mxfh on Wednesday April 01, 2015 @08:01PM (#9307835)
Not even counting the numerous cases of white spaces[1], combining characters, non-breaking space, figure space, soft hyphens or zero-width joiners. This sounds difficult enough in latin script, almost impossible to capture all cases in non LTR, non-latin grapheme based texts.

[1] http://en.wikipedia.org/wiki/Whitespace_character

Re:The poor, misunderstood innerText by kangax on Wednesday April 01, 2015 @08:08PM (#9307866)
But browsers already take care of this. They collapse all the spaces in markup for non-pre-formatted blocks; they render block/inline elements accordingly; insert newlines where needed, etc. And then, once you select some text from the page — there's your "plain text" representation. We probably can't avoid differences among browsers (simply due to the vast nature of HTML — form controls, media content, generated content, new elements like <template>, non-standard extensions, etc.) but in context of a single browser, the logic already exists beneath. It's just not exposed conveniently.