mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-26 18:51:50 +02:00
Merge pull request #14588 from overleaf/ae-paste-blockquote
[visual] Handle pasted blockquote GitOrigin-RevId: 5acc257a464886c1f90daf9192c87cccf158927e
This commit is contained in:
@@ -543,4 +543,9 @@ const selectors = [
|
||||
element.nextElementSibling?.nodeName === 'P' && hasContent(element),
|
||||
end: () => '\n\n',
|
||||
}),
|
||||
createSelector({
|
||||
selector: 'blockquote',
|
||||
start: () => `\n\n\\begin{quote}\n`,
|
||||
end: () => `\n\\end{quote}\n\n`,
|
||||
}),
|
||||
]
|
||||
|
||||
@@ -251,6 +251,25 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
)
|
||||
})
|
||||
|
||||
it('handles a pasted blockquote', function () {
|
||||
mountEditor()
|
||||
|
||||
const data = 'test <blockquote>foo</blockquote> test'
|
||||
|
||||
const clipboardData = new DataTransfer()
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should('have.text', 'test foo test')
|
||||
cy.get('.ol-cm-environment-quote').should('have.length', 5)
|
||||
|
||||
cy.get('.cm-line').eq(2).click()
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'test \\begin{quote}foo\\end{quote} test'
|
||||
)
|
||||
})
|
||||
|
||||
it('handles pasted inline code', function () {
|
||||
mountEditor()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user