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

URL preview for some web sites is very long #2894

Closed
radix opened this issue Jan 6, 2017 · 8 comments
Closed

URL preview for some web sites is very long #2894

radix opened this issue Jan 6, 2017 · 8 comments

Comments

@radix
Copy link
Contributor

radix commented Jan 6, 2017

Here's an example using http://xion.io/drafts/rust-unit-test-placement.html (which I'm not sure will be there permanently). Somehow riot decided that the whole content of the post should be in the preview.

riot-preview-too-long

@richvdh
Copy link
Member

richvdh commented Jan 9, 2017

matrix-org/synapse#1430, but I couldn't find an issue open to track it from the riot side, so keeping this open too

@uhoreg
Copy link
Member

uhoreg commented Apr 11, 2017

An easy fix to this may be to add some styles to limit the height of the preview. For example,

.mx_LinkPreviewWidget_description {
  max-height: 10em;
  overflow-y: auto;
}

@lukebarnard1
Copy link
Contributor

lukebarnard1 commented May 17, 2017

Having a scrollbar (using overflow-y: auto) seems odd as you end up with something like
2017-05-17-132052_492x358_scrot

I think I'd prefer using text-overflow: ellipsis somehow to add a "..." automatically, rather than relying on the "..." being done server-side.

@uhoreg
Copy link
Member

uhoreg commented May 17, 2017

Yup, using text-overflow instead of overflow-y seems fine to me.

@t3chguy
Copy link
Member

t3chguy commented May 23, 2017

Should be fixed by matrix-org/synapse/pull/2243

@t3chguy t3chguy closed this as completed May 23, 2017
@t3chguy
Copy link
Member

t3chguy commented May 23, 2017

Though comments have been made that Riot should handle this too, so reopening for that discussion

@nukeop
Copy link

nukeop commented Oct 9, 2018

Still occurs, can it be solved in frontend somehow? Like limiting the height of the preview box and adding ellipsis?

@MadLittleMods
Copy link
Contributor

It looks like this has some webkit specific styles to accomplish this nowadays ⏩ and it even seems like that vendor prefixed property is also supported in everything else except Internet explorer, https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp#browser_compatibility

display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;

The preview is cut off after 3 lines of text:

vs the full description in the DOM which you can see on wider screens:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants