-
Notifications
You must be signed in to change notification settings - Fork 91
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
Inserting image into line of text will add line break two chars after #3427
Comments
This is still an issue. We should really use gapcursor instead of adding empty lines. |
github-project-automation
bot
moved this to 🧭 Planning evaluation (don't pick)
in 📝 Office team
Jun 16, 2023
mejo-
moved this from 🧭 Planning evaluation (don't pick)
to 📄 To do (~10 entries)
in 📝 Office team
Jul 25, 2023
mejo-
added a commit
that referenced
this issue
Dec 6, 2023
Fixes: #3427 Signed-off-by: Jonas <[email protected]>
2 tasks
github-project-automation
bot
moved this from 🏗️ In progress
to ☑️ Done
in 📝 Office team
Dec 6, 2023
mejo-
added a commit
that referenced
this issue
Dec 6, 2023
Fixes: #3427 Signed-off-by: Jonas <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a follow up to #3282.
We currently the cursor two steps further after inserting the image and before inserting the hard break (if the image is not inserted as first element, which needs other special treatment). This is necessary because per default the cursor is in front of the image after inserting it, but we want to add the hard break afterwards.
If you insert an image in between text, this results in the linebreak being inserted two characters further for the moment. I think that's an acceptable tradeoff given that images are block nodes now and most likely it will not happen that often that people insert them in the middle of text anyway.
Here's the relevant code:
text/src/components/Editor/MediaHandler.vue
Lines 199 to 209 in 02dc2ba
If you have a quick idea how to detect that the cursor (i.e. the focus,
this.$editor.view.state.selection
) is in the middle of some text and not at the end of a paragraph, we could add this as another special handling. But instead of waiting longer and spending another bunch of hours on this minor issue, my suggestion would be to merge this PR as is now 😉Originally posted by @mejo- in #3282 (comment)
The text was updated successfully, but these errors were encountered: