diff --git a/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js b/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js index 482e30c2..4e96f2a4 100644 --- a/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js +++ b/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js @@ -5,7 +5,7 @@ context('/examples/export-html-or-json', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('
Example Text
') + editor.commands.setContent('Example Text
') }) }) diff --git a/docs/src/demos/Examples/MarkdownShortcuts/index.spec.js b/docs/src/demos/Examples/MarkdownShortcuts/index.spec.js index d284e7b2..2f7ec815 100644 --- a/docs/src/demos/Examples/MarkdownShortcuts/index.spec.js +++ b/docs/src/demos/Examples/MarkdownShortcuts/index.spec.js @@ -5,7 +5,7 @@ context('/examples/markdown-shortcuts', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.clearContent() + editor.commands.clearContent() }) }) diff --git a/docs/src/demos/Examples/ReadOnly/index.spec.js b/docs/src/demos/Examples/ReadOnly/index.spec.js index ed60f7c5..2b1e4789 100644 --- a/docs/src/demos/Examples/ReadOnly/index.spec.js +++ b/docs/src/demos/Examples/ReadOnly/index.spec.js @@ -7,7 +7,7 @@ context('/examples/read-only', () => { cy.get('.ProseMirror').then(([{ editor }]) => { cy.get('#editable').uncheck() - editor.insertText('Edited: ') + editor.commands.insertText('Edited: ') cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ') }) @@ -17,7 +17,7 @@ context('/examples/read-only', () => { cy.get('.ProseMirror').then(([{ editor }]) => { cy.get('#editable').check() - editor.insertText('Edited: ') + editor.commands.insertText('Edited: ') cy.get('.ProseMirror p:first').should('contain', 'Edited: ') }) diff --git a/docs/src/demos/Extensions/History/index.spec.js b/docs/src/demos/Extensions/History/index.spec.js index ab1b18b5..da05f31a 100644 --- a/docs/src/demos/Extensions/History/index.spec.js +++ b/docs/src/demos/Extensions/History/index.spec.js @@ -5,7 +5,7 @@ context('/api/extensions/history', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Mistake
') + editor.commands.setContent('Mistake
') }) }) diff --git a/docs/src/demos/Extensions/TextAlign/index.spec.js b/docs/src/demos/Extensions/TextAlign/index.spec.js index 3ebbd435..a31d7c4f 100644 --- a/docs/src/demos/Extensions/TextAlign/index.spec.js +++ b/docs/src/demos/Extensions/TextAlign/index.spec.js @@ -5,34 +5,34 @@ context('/api/extensions/text-align', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') }) }) it('should parse left align text correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('should parse center align text correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('should parse right align text correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('should parse left justify text correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) diff --git a/docs/src/demos/Extensions/Typography/index.spec.js b/docs/src/demos/Extensions/Typography/index.spec.js index af4fc82d..880d5794 100644 --- a/docs/src/demos/Extensions/Typography/index.spec.js +++ b/docs/src/demos/Extensions/Typography/index.spec.js @@ -5,7 +5,7 @@ context('/api/extensions/typography', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.clearContent() + editor.commands.clearContent() }) }) diff --git a/docs/src/demos/Marks/Bold/index.spec.js b/docs/src/demos/Marks/Bold/index.spec.js index d7d56680..afb9a369 100644 --- a/docs/src/demos/Marks/Bold/index.spec.js +++ b/docs/src/demos/Marks/Bold/index.spec.js @@ -5,37 +5,37 @@ context('/api/marks/bold', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should transform b tags to strong tags', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('sould omit b tags with normal font weight inline style', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('should transform any tag with bold inline style to strong tags', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) diff --git a/docs/src/demos/Marks/Code/index.spec.js b/docs/src/demos/Marks/Code/index.spec.js index 91e0fdd4..de958cfa 100644 --- a/docs/src/demos/Marks/Code/index.spec.js +++ b/docs/src/demos/Marks/Code/index.spec.js @@ -5,17 +5,17 @@ context('/api/marks/code', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse code tags correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text
Example Text
Example Text')
+ editor.commands.setContent('Example Text')
expect(editor.getHTML()).to.eq('Example Text
Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('i tags should be transformed to em tags', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('i tags with normal font style should be omitted', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('generic tags with italic style should be transformed to strong tags', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) diff --git a/docs/src/demos/Marks/Link/index.spec.js b/docs/src/demos/Marks/Link/index.spec.js index 4af1852d..af9bc526 100644 --- a/docs/src/demos/Marks/Link/index.spec.js +++ b/docs/src/demos/Marks/Link/index.spec.js @@ -5,28 +5,28 @@ context('/api/marks/link', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse a tags correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('') + editor.commands.setContent('') expect(editor.getHTML()).to.eq('') }) }) it('should parse a tags with target attribute correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('') + editor.commands.setContent('') expect(editor.getHTML()).to.eq('') }) }) it('should parse a tags with rel attribute correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('') + editor.commands.setContent('') expect(editor.getHTML()).to.eq('') }) }) diff --git a/docs/src/demos/Marks/Strike/index.spec.js b/docs/src/demos/Marks/Strike/index.spec.js index 98f40014..a61350a6 100644 --- a/docs/src/demos/Marks/Strike/index.spec.js +++ b/docs/src/demos/Marks/Strike/index.spec.js @@ -5,35 +5,35 @@ context('/api/marks/strike', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse s tags correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text
Example Text
Example Text
Example Text
Example Text
Example Text
Example Text
Example Text
Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse u tags correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('should transform any tag with text decoration underline to u tags', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) diff --git a/docs/src/demos/Nodes/Blockquote/index.spec.js b/docs/src/demos/Nodes/Blockquote/index.spec.js index e4318e0e..b456e504 100644 --- a/docs/src/demos/Nodes/Blockquote/index.spec.js +++ b/docs/src/demos/Nodes/Blockquote/index.spec.js @@ -5,21 +5,21 @@ context('/api/nodes/blockquote', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse blockquote tags correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) it('should parse blockquote tags without paragraphs correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text') + editor.commands.setContent('
Example Text') expect(editor.getHTML()).to.eq('
') }) }) @@ -38,8 +38,8 @@ context('/api/nodes/blockquote', () => { it('the button should wrap all nodes in one blockquote', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text
Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
Example Text
') + editor.commands.selectAll() }) cy.get('.demo__preview button:first') diff --git a/docs/src/demos/Nodes/BulletList/index.spec.js b/docs/src/demos/Nodes/BulletList/index.spec.js index 4d699aec..5d57b192 100644 --- a/docs/src/demos/Nodes/BulletList/index.spec.js +++ b/docs/src/demos/Nodes/BulletList/index.spec.js @@ -5,21 +5,21 @@ context('/api/nodes/bullet-list', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse unordered lists correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text
Example Text
Example Text
Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse code blocks correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text')
+ editor.commands.setContent('Example Text')
expect(editor.getHTML()).to.eq('Example Text')
})
})
it('should parse code blocks with language correctly', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.setContent('Example Text')
+ editor.commands.setContent('Example Text')
expect(editor.getHTML()).to.eq('Example Text')
})
})
@@ -74,7 +74,7 @@ context('/api/nodes/code-block', () => {
it('should parse the language from a HTML code block', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.setContent('body { display: none; }')
+ editor.commands.setContent('body { display: none; }')
cy.get('.ProseMirror')
.find('pre>code.language-css')
@@ -84,7 +84,7 @@ context('/api/nodes/code-block', () => {
it('should make a code block from backtick markdown shortcuts', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.clearContent()
+ editor.commands.clearContent()
cy.get('.ProseMirror')
.type('``` Code')
@@ -95,7 +95,7 @@ context('/api/nodes/code-block', () => {
it('should make a code block from tilde markdown shortcuts', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.clearContent()
+ editor.commands.clearContent()
cy.get('.ProseMirror')
.type('~~~ Code')
@@ -106,7 +106,7 @@ context('/api/nodes/code-block', () => {
it('should make a code block for js with backticks', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.clearContent()
+ editor.commands.clearContent()
cy.get('.ProseMirror')
.type('```js Code')
@@ -117,7 +117,7 @@ context('/api/nodes/code-block', () => {
it('should make a code block for js with tildes', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.clearContent()
+ editor.commands.clearContent()
cy.get('.ProseMirror')
.type('~~~js Code')
diff --git a/docs/src/demos/Nodes/Document/index.spec.js b/docs/src/demos/Nodes/Document/index.spec.js
index 59529eed..63b24cfb 100644
--- a/docs/src/demos/Nodes/Document/index.spec.js
+++ b/docs/src/demos/Nodes/Document/index.spec.js
@@ -5,7 +5,7 @@ context('/api/nodes/document', () => {
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.setContent('')
+ editor.commands.setContent('')
})
})
diff --git a/docs/src/demos/Nodes/HardBreak/index.spec.js b/docs/src/demos/Nodes/HardBreak/index.spec.js
index 86d516fd..8c834735 100644
--- a/docs/src/demos/Nodes/HardBreak/index.spec.js
+++ b/docs/src/demos/Nodes/HardBreak/index.spec.js
@@ -5,20 +5,20 @@ context('/api/nodes/hard-break', () => {
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
- editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') }) }) it('should parse hard breaks correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example
Text
Example
Text
Example
Text
Example
Text
Example
Text
Example
Text
Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) @@ -19,7 +19,7 @@ context('/api/nodes/heading', () => { headings.forEach(html => { it(`should parse headings correctly (${html})`, () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent(html) + editor.commands.setContent(html) expect(editor.getHTML()).to.eq(html) }) }) @@ -27,7 +27,7 @@ context('/api/nodes/heading', () => { it('should omit disabled heading levels', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') }) }) @@ -88,7 +88,7 @@ context('/api/nodes/heading', () => { it('should make a heading from the default markdown shortcut', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.clearContent() + editor.commands.clearContent() }) cy.get('.ProseMirror') diff --git a/docs/src/demos/Nodes/HorizontalRule/index.spec.js b/docs/src/demos/Nodes/HorizontalRule/index.spec.js index 77442db8..4b6a4033 100644 --- a/docs/src/demos/Nodes/HorizontalRule/index.spec.js +++ b/docs/src/demos/Nodes/HorizontalRule/index.spec.js @@ -5,20 +5,20 @@ context('/api/nodes/horizontal-rule', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') }) }) it('should parse horizontal rules correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text
Example Text
Example Text
Example Text
Example Text
Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) diff --git a/docs/src/demos/Nodes/OrderedList/index.spec.js b/docs/src/demos/Nodes/OrderedList/index.spec.js index 72c8ceec..b5f16049 100644 --- a/docs/src/demos/Nodes/OrderedList/index.spec.js +++ b/docs/src/demos/Nodes/OrderedList/index.spec.js @@ -5,21 +5,21 @@ context('/api/nodes/ordered-list', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse ordered lists correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text
Example Text
Example Text
Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') - editor.setContent('Example Text
') - editor.setContent('Example Text
') + editor.commands.setContent('Example Text
') expect(editor.getHTML()).to.eq('Example Text
') }) }) diff --git a/docs/src/demos/Nodes/TaskList/index.spec.js b/docs/src/demos/Nodes/TaskList/index.spec.js index 6696b566..4be7315d 100644 --- a/docs/src/demos/Nodes/TaskList/index.spec.js +++ b/docs/src/demos/Nodes/TaskList/index.spec.js @@ -5,21 +5,21 @@ context('/api/nodes/task-list', () => { beforeEach(() => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
') - editor.selectAll() + editor.commands.setContent('Example Text
') + editor.commands.selectAll() }) }) it('should parse unordered lists correctly', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.setContent('Example Text
Example Text
Example Text
Example Text