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

[stable25] Make images block nodes #3431

Merged
merged 9 commits into from
Nov 16, 2022
Merged

[stable25] Make images block nodes #3431

merged 9 commits into from
Nov 16, 2022

Conversation

backportbot-nextcloud[bot]
Copy link

@backportbot-nextcloud backportbot-nextcloud bot commented Nov 15, 2022

backport of #3282

@backportbot-nextcloud backportbot-nextcloud bot added the bug Something isn't working label Nov 15, 2022
@backportbot-nextcloud backportbot-nextcloud bot added this to the Nextcloud 25.0.2 milestone Nov 15, 2022
@cypress
Copy link

cypress bot commented Nov 15, 2022



Test summary

97 0 0 0Flakiness 0


Run details

Project Text
Status Passed
Commit e57d23f ℹ️
Started Nov 16, 2022 10:38 AM
Ended Nov 16, 2022 10:58 AM
Duration 20:11 💡
OS Linux Ubuntu - 20.04
Browser Electron 106

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

@max-nextcloud
Copy link
Collaborator

This PR mainly exists as a reminder to discuss if we want to backport this.

@mejo-
Copy link
Member

mejo- commented Nov 15, 2022

@juliushaertl since this fixes a bug in 25 (#2873), I think we should backport it to stable25 which is rather fresh still. Any objections?

@mejo- mejo- force-pushed the backport/3282/stable25 branch 2 times, most recently from d97e0a7 to de40ce7 Compare November 15, 2022 15:14
@juliusknorr
Copy link
Member

Yep, agreed that a backport makes sense 👍

mejo- and others added 8 commits November 15, 2022 20:40
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]>
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]>
@mejo-
Copy link
Member

mejo- commented Nov 15, 2022

/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' ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! 👍

@mejo- mejo- merged commit 6d99fc9 into stable25 Nov 16, 2022
@delete-merged-branch delete-merged-branch bot deleted the backport/3282/stable25 branch November 16, 2022 11:13
@blizzz blizzz mentioned this pull request Nov 21, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants