nextcloud/collectives

Link preview rendering bug

Closed this issue · 7 comments

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:

  • Collectives app version: 2.12.0
  • Nextcloud version: 29.0.0
  • PHP Version: 8.3.8
  • Database: mysql 8.0.37

Client details:

  • OS: Windows
  • Browser: Tested Firefox and Brave with the same result
  • Browser version: Firefox 128.0 (64-bit) / Brave 1.68.128
  • Device: desktop
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

mejo- commented

@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.

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

  • Collectives app version: 2.14.2
  • Nextcloud version: 29.0.6
  • PHP Version: 8.2.20
  • Browser: Firefox 129.0.1 on Windows 11 Pro

@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.

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

Nextcloud intro.mp4some text`

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

mejo- commented

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.

I updated to 29.0.7 and its resolved now.
thank you

mejo- commented

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