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

Attachments are formatted together with the next paragraph #2873

Closed
max-nextcloud opened this issue Sep 8, 2022 · 6 comments · Fixed by #3282
Closed

Attachments are formatted together with the next paragraph #2873

max-nextcloud opened this issue Sep 8, 2022 · 6 comments · Fixed by #3282
Assignees
Labels
bug Something isn't working high

Comments

@max-nextcloud
Copy link
Collaborator

Describe the bug
When changing the format below an attachment it also affects the attachment itself.

To Reproduce
Steps to reproduce the behavior:

  1. Open a text file
  2. Upload an attachment
  3. type somethign below
  4. change format below - heading, list, todo list

Expected behavior
The attachment stays the way it is. Formatting only affects the section below

Screencast
Bildschirmaufzeichnung vom 08.09.2022, 11:23:23.webm

@max-nextcloud max-nextcloud added the bug Something isn't working label Sep 8, 2022
@max-nextcloud
Copy link
Collaborator Author

I suspect attachments are inline elements and therefor form part of the next paragraph. I think they should be block elements in their own right.

@max-nextcloud
Copy link
Collaborator Author

@eneiluj Do you have an idea about this?

@vinicius73
Copy link
Member

Seems it is related to #2868

@mejo- mejo- added the high label Oct 10, 2022
@mejo-
Copy link
Member

mejo- commented Oct 17, 2022

The reason is that we intentionally set inline: true for image nodes. Not sure whether that's a good thing though, given that images (and attachments) are complex structures with nested div elements anyway in our ImageView.vue.

inline: true in the Image node configuration got introduced by the upgrade to TipTap2, specificially in this commit: edfbb70. The commit message says:

Tiptap v1 had inline images.
v2 keeps them outside of paragraphs by default.
Configure Image node to use inline images as markdownit creates inline images right now.

I'm not sure about the implications of switching to inline: false for image nodes (default in TipTap v2). A quick test at least fixed this bug 😉

@max-nextcloud, @juliushaertl and @vinicius73 curious about your thoughts 😊

@vinicius73
Copy link
Member

As we are using complex render strategies to render attachments, it can't be handled inline mode.

@mejo- mejo- self-assigned this Oct 17, 2022
@mejo-
Copy link
Member

mejo- commented Oct 17, 2022

As we are using complex render strategies to render attachments, it can't be handled inline mode.

I agree. I wonder though, what implications switching from inline to block mode has. Given that markdown-it creates inline images, would that result in modified markdown source code after opening and closing documents with images?

mejo- added a commit that referenced this issue Oct 19, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 19, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 19, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 24, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 24, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 25, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 27, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 31, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Oct 31, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Nov 8, 2022
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 <jonas@freesources.org>
max-nextcloud pushed a commit that referenced this issue Nov 14, 2022
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 <jonas@freesources.org>
max-nextcloud pushed a commit that referenced this issue Nov 15, 2022
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 <jonas@freesources.org>
backportbot-nextcloud bot pushed a commit that referenced this issue Nov 15, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Nov 15, 2022
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 <jonas@freesources.org>
mejo- added a commit that referenced this issue Nov 15, 2022
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 <jonas@freesources.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants