Skip to content

Commit d95df14

Browse files
committed
[FIX] clipboard: escape cell content
Escape cell content to avoid rendering the cell content as html when copy-pasting Task: 6214316
1 parent 5616fbe commit d95df14

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/plugins/ui_stateful/clipboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { Command, CommandResult, isCoreCommand, LocalCommand } from "../../types
2727
import { FileStore } from "../../types/files";
2828
import { Dimension, HeaderIndex, UID, Zone } from "../../types/misc";
2929
import { GridRenderingContext } from "../../types/rendering";
30-
import { xmlEscape } from "../../xlsx/helpers/xml_helpers";
30+
import { escapeXml, xmlEscape } from "../../xlsx/helpers/xml_helpers";
3131
import { UIPlugin, UIPluginConfig } from "../ui_plugin";
3232

3333
export const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5 MB
@@ -593,7 +593,7 @@ export class ClipboardPlugin extends UIPlugin {
593593
innerHTML = "\t";
594594
}
595595
} else if (cells.length === 1 && cells[0].length === 1) {
596-
innerHTML = `${this.getters.getCellText(cells[0][0].position)}`;
596+
innerHTML = escapeXml`${this.getters.getCellText(cells[0][0].position)}`.toString();
597597
} else if (!cells[0][0]) {
598598
return "";
599599
} else {

0 commit comments

Comments
 (0)