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 b2fde14 commit 28f0e37Copy full SHA for 28f0e37
src/paste-markdown-table.ts
@@ -85,7 +85,16 @@ function tableMarkdown(node: Element): string {
85
function parseTable(html: string): HTMLElement | null {
86
const el = document.createElement('div')
87
el.innerHTML = html
88
- return el.querySelector('table')
+
89
+ const table = el.querySelector('table')
90
+ table?.remove()
91
92
+ // Reject tables that have extra text around them.
93
+ if (el?.textContent?.trim()) {
94
+ return null
95
+ }
96
97
+ return table
98
}
99
100
function getTable(transfer: DataTransfer): HTMLElement | null {
0 commit comments