Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no BR tag in block tool text #891

Closed
gkshi opened this issue Sep 10, 2019 · 6 comments
Closed

no BR tag in block tool text #891

gkshi opened this issue Sep 10, 2019 · 6 comments

Comments

@gkshi
Copy link

gkshi commented Sep 10, 2019

image

Hello. It seems line breaks are not adding into text.
In latest Chrome and Safari I can't add line break in block tool with enableLineBreaks: true property (such as Quote and other custom tools).
You can get this case when just typing a text and press Enter, not paste.

@hata6502
Copy link
Contributor

It may be resolved with sanitize settings.

https://github.com/editor-js/paragraph/blob/master/src/index.js

  static get sanitize() {
    return {
      text: {
        br: true,
      }
    };
  }

@gkshi
Copy link
Author

gkshi commented Dec 17, 2019

I use original Quote plugin, it includes sanitize method with br option by default. But it's not working correctly.

There is a gif from editorjs website. No br tag in text.
ezgif-2-3cb9dd09e85e

@Stanko
Copy link

Stanko commented Dec 21, 2020

Try adding div to the sanitize settings. It worked for us as a fix for Safari. Safari adds <div><br></div> instead of <br> and then divs get sanitized and removed.

  /**
   * Sanitizer rules
   */
  static get sanitize() {
    return {
      text: {
        br: true,
        div: true,
      },
    };
  }

@gkshi
Copy link
Author

gkshi commented Dec 21, 2020

Thanks everybody, guys, I'll close the issue, it's no more actual for me.

@gkshi gkshi closed this as completed Dec 21, 2020
@mirkomaty
Copy link

@gkshi: How did you solve the problem? I have similar issues.

@gkshi
Copy link
Author

gkshi commented Jan 9, 2021

@mirkomaty Hi, I've not solved the problem finally. I think it's a quite important bug. You can reopen the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants