Giter Site home page Giter Site logo

Comments (5)

MrJuanGaviriaK avatar MrJuanGaviriaK commented on July 17, 2024 3

Hi @komaldembla, @juanhurtado10

I've checked the issue and I noticed it is not related to the undo plugin.

Editor.js does not manage a line break as an empty block or an empty paragraph block then, the undo plugin just can't restore it because this is not even persisted into the history stack:

Screen Shot 2021-08-19 at 11 08 56 AM

There are workarounds to solve this:

  • Use ENTER+SHIFT to lines break, you would get:
    Screen Shot 2021-08-19 at 11 15 01 AM
  • Use editorjs-break-line, If you need a breake-line component, editorjs-undo works perfectly with this plugin

But definitely, a root solution may be done on the editor.js core. Here are some references:

Best,
Juan Gaviria

from editorjs-undo.

juanhurtado10 avatar juanhurtado10 commented on July 17, 2024 3

@komaldembla @MrJuanGaviriaK

Screen.Recording.2021-09-08.at.5.07.51.PM.mov

After researching, I found that the following config allows the Undo plugin to recover the empty blocks.

  paragraph: {
    class: Paragraph,
    inlineToolbar: true,
    config: {
      preserveBlank: true,
    },
  },
  ...

from editorjs-undo.

komaldembla avatar komaldembla commented on July 17, 2024 1

Please find the list

Device, Browser, OS:

  • Macbook Pro, Chrome (92.0.4515.107), MacOS Catalina

Editor.js version: 2.22.0

Plugins used with their versions:

  • editorjs/checklist (1.3.0),
  • editorjs/delimiter (1.2.0),
  • editorjs/header (2.6.1)
  • editorjs/link (2.3.1)
  • editorjs/list (1.6.2)
  • editorjs/paragraph (2.8.0)
  • editorjs/underline (1.0.0)
  • editorjs-text-color-plugin (1.1.22)

from editorjs-undo.

komaldembla avatar komaldembla commented on July 17, 2024 1

@juanhurtado10 - Thank you so much! This works :)

from editorjs-undo.

komaldembla avatar komaldembla commented on July 17, 2024

Thanks for the quick response here @MrJuanGaviriaK! I'll check the workarounds.

from editorjs-undo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.