We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 868f683 commit 0c88719Copy full SHA for 0c88719
src/extensions/shared/paste-html-table-as-string.ts
@@ -35,13 +35,13 @@ const PasteHTMLTableAsString = Extension.create({
35
36
// Concatenate all tables into a single string of paragraphs
37
return tableHTML.reduce((result, table) => {
38
- const { firstElementChild: tableElement } = parseHtmlToElement(
39
- table,
40
- ) as {
41
- firstElementChild: HTMLTableElement | null
42
- }
+ const { firstElementChild: tableElement } = parseHtmlToElement(table)
43
44
- if (!tableElement) {
+ if (
+ !tableElement ||
+ !(tableElement instanceof HTMLTableElement) ||
+ !tableElement.rows
+ ) {
45
return result
46
}
47
0 commit comments