diff --git a/demos/src/Commands/InsertContent/Vue/index.html b/demos/src/Commands/InsertContent/React/index.html similarity index 100% rename from demos/src/Commands/InsertContent/Vue/index.html rename to demos/src/Commands/InsertContent/React/index.html diff --git a/demos/src/Issues/2720/React/index.jsx b/demos/src/Commands/InsertContent/React/index.jsx similarity index 88% rename from demos/src/Issues/2720/React/index.jsx rename to demos/src/Commands/InsertContent/React/index.jsx index ac574f71d6d..e2ffe37d1f5 100644 --- a/demos/src/Issues/2720/React/index.jsx +++ b/demos/src/Commands/InsertContent/React/index.jsx @@ -33,6 +33,9 @@ const MenuBar = () => { + diff --git a/demos/src/Issues/2720/React/index.spec.js b/demos/src/Commands/InsertContent/React/index.spec.js similarity index 62% rename from demos/src/Issues/2720/React/index.spec.js rename to demos/src/Commands/InsertContent/React/index.spec.js index 025c7b7b3d6..0bbb643d8c2 100644 --- a/demos/src/Issues/2720/React/index.spec.js +++ b/demos/src/Commands/InsertContent/React/index.spec.js @@ -1,4 +1,4 @@ -context('/src/Issues/2720/React/', () => { +context('/src/Commands/InsertContent/React/', () => { before(() => { cy.visit('/src/Issues/2720/React/') }) @@ -14,6 +14,20 @@ context('/src/Issues/2720/React/', () => { cy.get('.tiptap').should('contain.html', '
Hello World
This is a paragraph
with a break.
And this is some additional string content.
') }) + it('should keep spaces inbetween tags in html content', () => { + cy.get('.tiptap').then(([{ editor }]) => { + editor.commands.insertContent('Hello World
') + cy.get('.tiptap').should('contain.html', 'Hello World
') + }) + }) + + it('should keep empty spaces', () => { + cy.get('.tiptap').then(([{ editor }]) => { + editor.commands.insertContent(' ') + cy.get('.tiptap').should('contain.html', '') + }) + }) + it('should insert text content correctly', () => { cy.get('button[data-test-id="text-content"]').click() @@ -23,7 +37,7 @@ context('/src/Issues/2720/React/', () => { it('should keep newlines in pre tag', () => { cy.get('.tiptap').then(([{ editor }]) => { - editor.commands.setContent('
foo\nbar
')
+ editor.commands.insertContent('foo\nbar
')
cy.get('.tiptap').should('contain.html', 'foo\nbar
')
})
})
diff --git a/demos/src/Issues/2720/React/styles.scss b/demos/src/Commands/InsertContent/React/styles.scss
similarity index 100%
rename from demos/src/Issues/2720/React/styles.scss
rename to demos/src/Commands/InsertContent/React/styles.scss
diff --git a/demos/src/Commands/InsertContent/Vue/index.vue b/demos/src/Commands/InsertContent/Vue/index.vue
deleted file mode 100644
index a4366b419bf..00000000000
--- a/demos/src/Commands/InsertContent/Vue/index.vue
+++ /dev/null
@@ -1,102 +0,0 @@
-
-