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

Fix relative image url fetched from stylesheet domain #591

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

p1gp1g
Copy link
Contributor

@p1gp1g p1gp1g commented Jun 4, 2024

Partial URLs are interpreted relative to the source of the style sheet, not relative to the document
https://www.w3.org/TR/CSS1/


Before the patch, if the stylesheet is hosted on a remote host, the background images are retrieved from the stylesheet domain. For instance, on the following example, /img/1.jpg is fetched from https://cnd.jsdelivr.net/

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css" />
  </head>
  <body>
    <textarea id="my-text-area">
![](/img/1.jpg)
    </textarea>
[...]
  </body>
</html>

Partial URLs are interpreted relative to the source of
the style sheet, not relative to the document
https://www.w3.org/TR/CSS1/
@Ionaru Ionaru merged commit 65dfecf into Ionaru:master Jun 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants