Skip to content

Commit de8f6e7

Browse files
committed
should be a little more robust to html tags
1 parent 278852d commit de8f6e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,13 +926,13 @@ class CsvEditorProvider implements vscode.CustomTextEditorProvider {
926926
if(editingCell === cell) return;
927927
if(editingCell) editingCell.blur();
928928
cell.classList.remove('selected');
929-
originalCellValue = cell.innerText;
929+
originalCellValue = cell.textContent;
930930
editingCell = cell;
931931
cell.classList.add('editing');
932932
cell.setAttribute('contenteditable', 'true');
933933
cell.focus();
934934
const onBlurHandler = () => {
935-
const value = cell.innerText;
935+
const value = cell.textContent;
936936
const coords = getCellCoords(cell);
937937
vscode.postMessage({ type: 'editCell', row: coords.row, col: coords.col, value: value });
938938
cell.removeAttribute('contenteditable');
@@ -973,7 +973,7 @@ class CsvEditorProvider implements vscode.CustomTextEditorProvider {
973973
isUpdating = true;
974974
const { row, col, value } = message;
975975
const cell = table.querySelector('td[data-row="'+row+'"][data-col="'+col+'"]');
976-
if(cell){ cell.innerText = value; }
976+
if (cell) { cell.textContent = value; }
977977
isUpdating = false;
978978
}
979979
});

0 commit comments

Comments
 (0)