Replies: 9 comments 9 replies
-
I need to change that too |
Beta Was this translation helpful? Give feedback.
-
Describe your use case, pls. Why do you prefer such data: {
"time" : 1602768915881,
"blocks" : [
{
"type" : "paragraph",
"data" : {
"text" : "Line one<br>Line two<br>Line three"
}
}
],
"version" : "2.18.0"
} instead of this: {
"time" : 1602768915881,
"blocks" : [
{
"type" : "paragraph",
"data" : {
"text" : "Line one"
}
},
{
"type" : "paragraph",
"data" : {
"text" : "Line two"
}
},
{
"type" : "paragraph",
"data" : {
"text" : "Line three"
}
}
],
"version" : "2.18.0"
} ? |
Beta Was this translation helpful? Give feedback.
-
@neSpecc I have to prevent when the users types enter, and instead of create a new paragraph, it should just return a break line the enter key should be equal shift+enter https://staging.leorad.com.br/laudador/63 There are a bunch of pre set sentences there. If the user wants to improve that, they can continue writing, but when the user types enter, it must continue in the same block, it can not create a new block |
Beta Was this translation helpful? Give feedback.
-
I think I have to change this behavior |
Beta Was this translation helpful? Give feedback.
-
any news? did you guys figured? @neSpecc that's exactly what i need. |
Beta Was this translation helpful? Give feedback.
-
Interested too. |
Beta Was this translation helpful? Give feedback.
-
This is what I have so far if you guys are interested - it's not perfect but it's a start. I will update it once I perfect it (minor issue with This code is in a custom block - clone the
|
Beta Was this translation helpful? Give feedback.
-
Updated:
|
Beta Was this translation helpful? Give feedback.
-
Reviving this old thread because I thought it could be quite useful for others. I have tried @sadikyalcin solution, it mostly worked but I still ended up having to press enter twice for certain occasions. I think the inspiration here is, just create your own block plugin if is not meant to function like a "paragraph". This make sense and I have created my own plugin to suit for my project's requirement. Here is the barebones version that has worked for me - I have modified the namings that suits for poetry example :
CSS - this is important, because if the wrapper is a standard "block", the breaklines are wrapped with a div:
The idea of this is, if the EditorJS default behaviour is not suitable for certain use-case, you can create a plugin to use the standard browser-native contenteditable. You won't need to worry about implementing your own processing to determine inserting one or two br tags. |
Beta Was this translation helpful? Give feedback.
-
The question.
Can I swap the shortcut key for Soft Line Break (ENTER+SHIFT) with Hard Line Break (ENTER) ?
Why and how the question has come up.
I just want to make sure that if the user presses ENTER key the user will create a newline on the existing paragraph without creating a new one so a set of lines can be grouped together easily.
Beta Was this translation helpful? Give feedback.
All reactions