Attempt to fix bug in Firefox where textContent has space as value