-
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
[stable25] Make images block nodes #3431
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
This PR mainly exists as a reminder to discuss if we want to backport this. |
@juliushaertl since this fixes a bug in 25 (#2873), I think we should backport it to stable25 which is rather fresh still. Any objections? |
d97e0a7
to
de40ce7
Compare
Yep, agreed that a backport makes sense 👍 |
Signed-off-by: Jonas <[email protected]>
Use markdown-it-image-figures to render standalone images inside `<figure>` elements instead of `<p>` when markdown source gets parsed into HTML. This allows to treat images as block elements by TipTap. Also keep support for inline images to not break markdown files that have inline images. Fixes: #2873 Signed-off-by: Jonas <[email protected]>
Replace `<p>` with `<figure>` now that we use markdown-it-image-figures. Signed-off-by: Jonas <[email protected]>
Signed-off-by: Jonas <[email protected]>
Needed to prevent block images getting merged with next paragraph. Signed-off-by: Jonas <[email protected]>
Tiptap `setImage()` marks the added image as selected when added as first element in the document), which leads to the image being overwritten by subsequent `insertContent()` command. See ueberdosis/tiptap#3355 for the relevant upstream bug. Mitigate this bug by explicitly placing the cursor at the end of the selection between adding the image and the line break. Signed-off-by: Jonas <[email protected]>
Right now we add an empty line after each image so it lives in its own paragraph. This is not needed at the end of the file and we should preserve the number of newlines instead (#3428). But for now it should not block merging the block images pr #3282. Signed-off-by: Max <[email protected]>
Signed-off-by: Jonas <[email protected]>
303f4d7
to
518099f
Compare
/compile |
Signed-off-by: nextcloud-command <[email protected]>
@@ -27,7 +27,7 @@ jobs: | |||
containers: [1, 2, 3, 4] | |||
php-versions: [ '7.4' ] | |||
databases: [ 'sqlite' ] | |||
server-versions: [ 'master' ] | |||
server-versions: [ 'stable25' ] |
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.
good catch! 👍
backport of #3282