diff --git a/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js b/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js index 31e36b4b..396e4bb5 100644 --- a/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js +++ b/docs/src/demos/Examples/ExportHtmlOrJson/index.spec.js @@ -1,8 +1,14 @@ context('/examples/export-html-or-json', () => { - beforeEach(() => { + before(() => { cy.visit('/examples/export-html-or-json') }) + beforeEach(() => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.setContent('
Example Text
') + }) + }) + it('should return json', () => { cy.get('.ProseMirror').then(([{ editor }]) => { const json = editor.json() @@ -15,33 +21,7 @@ context('/examples/export-html-or-json', () => { content: [ { type: 'text', - text: 'You are able to export your data as ', - }, - { - type: 'text', - marks: [ - { - type: 'code', - }, - ], - text: 'HTML', - }, - { - type: 'text', - text: ' or ', - }, - { - type: 'text', - marks: [ - { - type: 'code', - }, - ], - text: 'JSON', - }, - { - type: 'text', - text: '.', + text: 'Example Text', }, ], }, @@ -54,7 +34,7 @@ context('/examples/export-html-or-json', () => { cy.get('.ProseMirror').then(([{ editor }]) => { const html = editor.html() - expect(html).to.equal('You are able to export your data as HTML or JSON.
Example Text
') }) }) }) diff --git a/docs/src/demos/Examples/ExportHtmlOrJson/index.vue b/docs/src/demos/Examples/ExportHtmlOrJson/index.vue index c10b0369..d4e08f1e 100644 --- a/docs/src/demos/Examples/ExportHtmlOrJson/index.vue +++ b/docs/src/demos/Examples/ExportHtmlOrJson/index.vue @@ -1,7 +1,5 @@
+ {{ html }}
+
- You are able to export your data as HTML or JSON.
+ What would be a text editor without content. At some point you want to get the content out of the editor and yes, we got you covered. There are two methods to export the current document as HTML or JSON.
+
+ You can hook into the update event to get the content after every single change. How cool is that?
- Try to change some content here. With the History extension you are able to undo and redo your changes. You can also use keyboard shortcuts for this (Control/Command + Z and Control/Command + Shift + Z).
+ With the History extension the Editor will keep track of your changes. And if you think you made a mistake, you can redo your changes. Try it out, change the content and hit the undo button!
+
+ And yes, you can also use a keyboard shortcut to undo changes (Control/Cmd Z) or redo changes (Control/Cmd Shift Z).
- Start a new line and type # followed by a space to get a headline. Try #, ##, ###, ####, #####, ###### for different levels.
+ Start a new line and type # followed by a space to get a heading. Try #, ##, ###, ####, #####, ###### for different levels.
- Those conventions are called input rules in tiptap. Some of those shortcuts are enabled by default. Try > for blockquotes, *, - or + for bullet lists, \`foobar\` to highlight code.
+ Those conventions are called input rules in tiptap. Some of them are enabled by default. Try > for blockquotes, *, - or + for bullet lists, or \`foobar\` to highlight code.
- You can add your own input rules through adding the inputRules() method in your nodes and marks.
+ You can add your own input rules to your Nodes and Marks or even to the default ones.