nextcloud / collectives

Collectives is a Nextcloud App for activist and community projects to organize together.
GNU Affero General Public License v3.0
100 stars 18 forks source link

Link preview rendering bug #1388

Closed greg-super closed 1 month ago

greg-super commented 3 months ago

In collectives when I have a any type of link to show inline preview with anything after it (i.e text) it doesn't render correctly. In edit mode it seems fine however when clicking done, it switches to view mode it renders just text

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a new page or collective
  2. click on the insert link button and choose any link
  3. click the 3 dots beside the link and select "Show link preview"
  4. add some text after the preview
  5. Click done and see the error

Expected behavior The preview disappears and the link text with the additional text is rendered together as if the text after the link was part of the link and this also removes the click function of the link.

Additional Notes: Interestingly if I click edit the preview comes back. So I've changed the collective settings to default to the edit page mode, however over a short time the edit mode ends up rendering just like to view mode.

Screenshots before clicking done after clicking done

Server details:

Logs #### Nextcloud log (data/nextcloud.log) ``` Insert your Nextcloud log here there is no log data from this event #### Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log ![consolelog](https://github.com/user-attachments/assets/b3abd21d-085c-4570-a8d0-bb252f66d49c)
mejo- commented 2 months ago

@greg-super are you still able to reproduce this issue? If so, can you please provide the markdown source of the document in question? So far I was unable to reproduce this issue in my tests.

beistehen commented 2 months ago

@mejo- I came here to report the same issue but now I can't reproduce. Will continue to investigate and report back.

beistehen commented 2 months ago

@mejo- some more info: It looks like it happens to .md files which are uploaded via Files app directly into a Collectives folder. After a link is added to the uploaded document and the document is saved, the link is visible in preview. When switching to another document and back, the link disappears. Looking at the file sizes in the version history it is clear that the URL of the link has been added but the link is not rendered.

After switching between documents back and forth for a minute or two or even logging out and back in, rendering of the link takes place as expected in preview.

greg-super commented 2 months ago

@mejo- I have just recreated it with the below markdown straight from the .md file `this is a test

[Nextcloud intro.mp4](https://**.com/index.php/f/5 (preview))some text`

I should let you know that I have also updated the app Collectives app version: 2.14.2

mejo- commented 1 month ago

Unfortunately I was unable to reproduce this issue so far. It seems like the serialization to markdown misses to add a newline after the preview link. There was a bug in Nextcloud 29.0.4 and before that could trigger this bug.

Are you sure that you that you're still able to reproduce this with Nextcloud 29.0.7 and newer? With reproduce I mean create a new file, add the link and then see the bug - not open an old file that had this bug.

greg-super commented 1 month ago

I updated to 29.0.7 and its resolved now. thank you

mejo- commented 1 month ago

@greg-super thanks for checking again. Glad to hear that the issue got solved for you.