fixed _getPositionForTextIndex for empty paragraph