[visual] Improve pasting of a table containing a caption (#14322)

GitOrigin-RevId: 6d7676a9412c5614f85c17e16509c80ad937cc40
This commit is contained in:
Alf Eaton
2023-08-16 08:04:01 +00:00
committed by Copybot
parent a8d7306fc4
commit a55bb9c4b2
2 changed files with 50 additions and 8 deletions
@@ -132,6 +132,23 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
)
})
it('handles a pasted table with a caption', function () {
mountEditor()
const data =
'<table><caption>A table</caption><tbody><tr><td>foo</td><td>bar</td></tr></tbody></table>'
const clipboardData = new DataTransfer()
clipboardData.setData('text/html', data)
cy.spy(clipboardData, 'getData').as('get-data')
cy.get('@content').trigger('paste', { clipboardData })
cy.get('@content').should(
'have.text',
'A table\\begin{tabular}{c c}foo & bar ↩\\end{tabular}'
)
})
it('handles a pasted link', function () {
mountEditor()