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

Provide a way to leave code marks (when there’s no content after them) #90

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/Marks/Code/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,18 @@ context('/demos/Marks/Code', () => {
.find('code')
.should('contain', 'Example')
})

it.only('leaves the inline code mark with keyboard shortcut', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.clearContent()

cy.get('.ProseMirror')
.type('`Example`{leftarrow}{rightarrow}')
.trigger('keydown', { shiftKey: true, key: 'Enter' })
.type('Text')
.find('code')
.should('contain', 'Example')
.should('not.contain', 'ExampleText')
})
})
})