text
text copied to clipboard
Attachments are formatted together with the next paragraph
Describe the bug When changing the format below an attachment it also affects the attachment itself.
To Reproduce Steps to reproduce the behavior:
- Open a text file
- Upload an attachment
- type somethign below
- 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
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.
@eneiluj Do you have an idea about this?
Seems it is related to #2868
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: edfbb70f1578dad76ff869b9f2ca0f3c027232d2. 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 :wink:
@max-nextcloud, @juliushaertl and @vinicius73 curious about your thoughts :blush:
As we are using complex render strategies to render attachments, it can't be handled inline mode.
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?