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

markdown preview: Image support #10565

Closed
wants to merge 13 commits into from
Closed

markdown preview: Image support #10565

wants to merge 13 commits into from

Conversation

bennetbo
Copy link
Contributor

@bennetbo bennetbo commented Apr 15, 2024

This PR adds support for rendering images inside the markdown preview.

Screen.Recording.2024-04-19.at.22.08.55.mov

Note: gpui does not support rendering inline elements inside a text, therefore this implementation inserts line breaks if a paragraph contains an image in between some text, which is not correct:

image

I think this behavior is still better than not supporting images at all and I believe most usages of images inside markdown are not "inline".

Release Notes:

  • Add support for rendering images inside the markdown preview

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 15, 2024
@bennetbo bennetbo marked this pull request as draft April 15, 2024 16:55
@bennetbo bennetbo marked this pull request as ready for review April 19, 2024 20:09
@bennetbo
Copy link
Contributor Author

bennetbo commented May 2, 2024

Works inside tables now, although the alignment is wrong (but that is an existing bug, see #11024)

image

@bennetbo
Copy link
Contributor Author

Closing this, the implementation seems to work fine, but the img element needs some better error handling first.
If there is an image with a url that is invalid we try to download that image over and over again without any timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant