Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Image inside tooltips don't render #200

Closed
humitos opened this issue Jun 14, 2022 · 3 comments
Closed

Image inside tooltips don't render #200

humitos opened this issue Jun 14, 2022 · 3 comments
Assignees

Comments

@humitos
Copy link
Member

humitos commented Jun 14, 2022

The following text was copied and pasted from orchest/orchest#1041 (comment)


Another issue that I noticed is that some images from the tooltips are not being rendered for some reason. It seems it's using a relative path ../_images/services.png when it should be using the absolute path /_images/services.png

Screenshot_2022-06-10_12-06-17

The reST code for this is located at https://github.com/humitos/orchest/blob/625a0f6929f5b7862a0dca4010d55615b8c7e740/docs/source/fundamentals/services.rst#L24

@humitos
Copy link
Member Author

humitos commented Jun 14, 2022

I just found this issue in our own documentation as well:
Screenshot_2022-06-14_17-52-57

https://docs.readthedocs.io/en/stable/commercial/single-sign-on.html#single-sign-on

humitos added a commit to readthedocs/readthedocs.org that referenced this issue Jun 15, 2022
When returning the content to be injected in a tooltip, besides cleaning the
`a.href` we are also cleaning the `img.src` to make them absolute and render the
images properly.

See readthedocs/sphinx-hoverxref#200
@humitos
Copy link
Member Author

humitos commented Jun 15, 2022

I opened readthedocs/readthedocs.org#9337 in the backend which fixes this issue.

@humitos humitos moved this from Planned to Needs review in 📍Roadmap Jun 15, 2022
humitos added a commit to readthedocs/readthedocs.org that referenced this issue Jun 16, 2022
* EmbedAPI: small refactor

- rename `clean_links` as `clean_references`
- rename `URLData.href` as `URLData.ref`

This is done because this function will clean `a.href` and also `img.src` now.

* EmbedAPI: clean images (src) properly from inside a tooltip

When returning the content to be injected in a tooltip, besides cleaning the
`a.href` we are also cleaning the `img.src` to make them absolute and render the
images properly.

See readthedocs/sphinx-hoverxref#200

* EmbedAPI: use absolute URL on HTML data for tests

These `src=` fields are not cleaned by `clean_references`.
@ericholscher
Copy link
Member

Looks like that PR got merged. Closing this. 👍

Repository owner moved this from Needs review to Done in 📍Roadmap Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants