Need full preview of text files when sharing

Nextcloud version (eg, 20.0.5): 21.0.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.43
PHP version (eg, 7.4): 7.3

The issue you are facing:
When sharing a text file ( the preview gets cut off after a few lines. I would really love to change that but despite wasting many hours looking through the nextcloud files I cannot find the script responsible for that. I would love to have it just show the full file. I am aware that in certain situations this might be a bad Idea. Also a little sidenote: The limit seems to be different on each device.

If someone knows where this preview is made / how to accomplish that please let me know!

Steps to replicate it:

  1. Create a text file
  2. Add a bunch of lines
  3. Share


Stuff I figured out:
  • The HTML reveals that the text gets modified by “imgframe.text-preview”
    This is located in /nextcloud/apps/files_sharing/css/public.scss

  • Issue being that my HTML says “text-preview default-overridden” which is confusing to me. I havent found the code responsible for that overwrite despite me doing a full grep of the entire nextcloud instance.

  • Another thing I got hinted to by @bb77 is that the app responsible for scrolling is “Nextcloud Text” which I swapped out for another one because I needed markdown. I guess I will try to make them co-exist in a peaceful manner with each other since enabling that fixed the scrolling issue.

Hi @VerstreuteSeele

Strange… On my instance shared .txt or .md files open in Nextcloud Text and there is a scrollbar on the right side. Unfortunately, I don’t know why this is not the case for you. Can you open these files in the browser when you are logged in to the webUI of your Nextcloud?

Hey. Thanks for the reply!

I added a drop-down to my original message for stuff I noticed. It seems like the nextcloud Text app is the issue. Or better its absence. marking this as a solution for now