kogmbh/WebODF — pull request #203 by peitschie (2013-11-21 05:20:20+00:00)
Title: Treat the first space text character after a text:tab as significant whitespace

A space character is considered significant when it follows either a non-space character element (e.g., text:tab), or a non-space character.

From the ODF specs (6.1.3, ):
This element shall be used to represent the second and all following “ “ (U+0020, SPACE) characters in a sequence of “ “ (U+0020, SPACE) characters.

Failure to do this properly causes some strange text insertion behaviour and a crash when pasting to the end of a document.

Reproduction steps (note, copy & paste only work properly in Chrome):
1. Open the editor (http://ci.kogmbh.com/deploy/WebODF/webodf-ci-b84-g48f62e2d/editor/localeditor.html)
1. Remove all content (including annotations) from the document
1. In the now-blank document, type a tab character followed by 2 spaces, a line break, and a letter (i.e., "\t \nW")
1. Select the entire document
1. Copy this to the clipboard
1. Remove all content
1. Paste the content into the blank document. Observe the uncaught exception "Cannot call method 'getElementsByTagNameNS' of null"