Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome v70+ has issue with innerText in td cells

This was working in v69 and lower.

Every innerText value of a cell before the last has a trailing character.

Check it out here: http://jsfiddle.net/L16x9gpe/

<html>
<body>
<table>
    <tr id='row'>
        <td>1</td>
        <td>2</td>
        <td>3</td>
    </tr>
</table>
</body>
</html>

Edit: I have raised an issue with Chromium development here: https://bugs.chromium.org/p/chromium/issues/detail?id=897373 It seems all browsers at the moment do not contain the trailing character issue, including Firefox where the original specification apparently was derived. The commit author Yoshifumi Inoue ([email protected]) has stated this should be the correct implementation. I think it should act like other browsers and not have this differentiating behavior. The whatwg spec should be changed to be more specific and only include a trailing tab character (U+0009) for table or row innerText calls instead of a direct call to a td cell.

like image 683
brg Avatar asked Oct 19 '18 23:10

brg


1 Answers

I have the exact same problem. The workaround I'm using for now is changing my code to cell.innerText.trim().

like image 117
N3K0100183 Avatar answered Oct 16 '22 21:10

N3K0100183