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

show texts with line breaks, inside a block #1032

Open
ghost opened this issue Feb 6, 2020 · 7 comments
Open

show texts with line breaks, inside a block #1032

ghost opened this issue Feb 6, 2020 · 7 comments

Comments

@ghost
Copy link

ghost commented Feb 6, 2020

Hey,

In editorjs, if it detects line breaks, it will break the whole text into several different blocks.
Here is the question:
If one hopes to load several paragraphs in a block, with line breaks remaining, how can we do that?
(When writing, we can do that by press shift+enter. But, after initiating block data, how do we show paragraphs with line breaks inside a single block?)

current:
image
hope it could be:
image

Thanks!

@neSpecc
Copy link
Member

neSpecc commented Feb 6, 2020

Editor.js supports shift+enter for creating linebreaks inside a single block. Saved data of this block will contain <br> tags. When you will render such data, the block will contain linebreaks.

I don't understand the issue.

@ghost
Copy link
Author

ghost commented Feb 8, 2020

Editor.js supports shift+enter for creating linebreaks inside a single block. Saved data of this block will contain <br> tags. When you will render such data, the block will contain linebreaks.

I don't understand the issue.

Hi, does editorjs allow saved data of a block contain \n, instead of < br > , for line breaks?

@neSpecc
Copy link
Member

neSpecc commented Feb 8, 2020

Hi, does editorjs allow saved data of a block contain \n, instead of < br > , for line breaks?

It depends on the plugins you use. For example, Code Tool will contain \n instead of <br>.

@gohabereg
Copy link
Member

Might be resolved by #1016

@shivchawla
Copy link

I am adding a header but I want to give line breaks at the beginning. it takes line beaks (it shows line breaks in the editor and inspect tab) but while parsing as block output, it drops the line breaks. I guess this needs a fix. Do you agree?

@tpnsolutions
Copy link

Shift+Enter works fine on computer, but mobile device treats it as a regular Enter which creates a new block. Is there a workaround for this?

@MussaratAziz
Copy link

can we map another key instead of SHIFT+ENTER? @neSpecc

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

No branches or pull requests

5 participants