-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Desktop: Fixes #12059: Fix Rich Text Editor deletes paragraphs when pressing enter after a resized image #12090
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
Desktop: Fixes #12059: Fix Rich Text Editor deletes paragraphs when pressing enter after a resized image #12090
Conversation
…image This change removes the wrapping <div id="rendered-md">, which seems to fix the removal of text after a resized image.
I see that #rendered-md is used a few times in CSS selectors. Is this change not going to affect this? |
#rendered-md > h1:first-child, | ||
#rendered-md > h2:first-child, | ||
#rendered-md > h3:first-child, | ||
#rendered-md > h4:first-child, | ||
#rendered-md > ul:first-child, | ||
#rendered-md > ol:first-child, | ||
#rendered-md > table:first-child, | ||
#rendered-md > blockquote:first-child, | ||
#rendered-md > img:first-child, | ||
#rendered-md > p:first-child { | ||
${contentWrapperTarget} > h1:first-child, | ||
${contentWrapperTarget} > h2:first-child, | ||
${contentWrapperTarget} > h3:first-child, | ||
${contentWrapperTarget} > h4:first-child, | ||
${contentWrapperTarget} > ul:first-child, | ||
${contentWrapperTarget} > ol:first-child, | ||
${contentWrapperTarget} > table:first-child, | ||
${contentWrapperTarget} > blockquote:first-child, | ||
${contentWrapperTarget} > img:first-child, | ||
${contentWrapperTarget} > p:first-child { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that #rendered-md is used a few times in CSS selectors. Is this change not going to affect this?
It shouldn't, at least not for the references to #rendered-md
in the core application. The above selectors are the relevant instances of #rendered-md
that I found. This pull request updates them to use a different selector when running in the Rich Text Editor and continue using #rendered-md
in the note viewer.
As commented in the pull request description, user-specified CSS and 3rd-party plugins may also rely on #rendered-md
.
Notes:
- An alternative to this pull request might be to try to patch TinyMCE to fix the upstream issue.
- I've briefly tried to do this, but was unsuccessful.
- Since TinyMCE v6 is no longer supported upstream and we can't upgrade to v7, it seems unlikely that Joplin will be able to apply an upstream fix (unless we switch to a fork of TinyMCE or locally apply a patch from a TinyMCE fork).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that sounds good, so let's merge it as it is then. There's just one conflict to be fixed first
…ce-crash-after-image-newline
Summary
Before this change, Markdown documents in the Rich Text Editor were wrapped in a
<div id="rendered-md">
. TinyMCE seems to be unable to handle this in some cases. This pull request removes therendered-md
wrapper when rendering in the Rich Text Editor.Resolves #12059.
Important
Although this change resolves #12059, it will break custom CSS that relies on the presence of the
<div id="rendered-md">
wrapping element.Testing plan
This pull request includes an automated test.
In addition to the automated test, the following manual testing has been done:
It has also been verified that changing the "editor maximum width" setting changes the spacing on either side of the editor content.