Skip to content

Commit 6c01407

Browse files
committed
Fix tests
1 parent 89fa5ba commit 6c01407

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/paste-markdown-table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ function generateText(transfer: DataTransfer): string | undefined {
9595

9696
const formattedTable = tableMarkdown(table)
9797

98-
return html.replace(/<meta.*?>/, '').replace(/<table.*<\/table>/, `\n${formattedTable}`)
98+
return html.replace(/<meta.*?>/, '').replace(/<table[.\S\s]*<\/table>/, `\n${formattedTable}`)
9999
}

test/test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ describe('paste-markdown', function () {
5353
`
5454
}
5555

56-
// Synthetic paste events don't manipulate the DOM. A empty textarea
57-
// means that the event handler didn't fire and normal paste happened.
5856
paste(textarea, data)
59-
assert.equal(textarea.value, '')
57+
assert.equal(
58+
textarea.value.trim(),
59+
// eslint-disable-next-line github/unescaped-html-literal
60+
'<p>Here is a cool table</p>\n \n\nname | origin\n-- | --\nhubot | github\nbender | futurama\n\n\n <p>Very cool</p>'
61+
)
6062
})
6163

6264
it('rejects layout tables', function () {

0 commit comments

Comments
 (0)