Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Keep line breaks from pasted text #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/src/demos/Examples/Default/Vue/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,18 @@ context('/demos/Examples/Default/Vue', () => {
.find('p')
.should('contain', 'Example Text')
})

it.only('keeps line breaks from pasted plain text', () => {
const text = `Paragraph 1
Paragraph 1

Paragraph 2`
const html = '<p>Paragraph 1<br />Paragraph 1</p><p>Paragraph 2</p>'

cy.get('.ProseMirror').paste({ pastePayload: text, pasteType: 'text/plain' })

cy.get('.ProseMirror').then(([{ editor }]) => {
expect(editor.getHTML()).to.eq(html)
})
})
})