Skip to content

Image URLs with spaces behave unexpectedly #3421

@Jupp56

Description

@Jupp56

Environment info

  • Cytoscape.js version : 3.33.1
  • Browser/Node.js & version : Firefox 144.0

Current (buggy) behaviour

Background images are not loaded/loaded from the wrong URL when the URL contains a space.
If I set "/images/image 1 2.jpeg", the image under that path is not displayed, but requests are made to the URLs "/images/image", "1", and "2.jpeg".

Desired behaviour

Cytoscape loads an image from "/images/image 1 2.jpeg" and display it as background image.

Minimum steps to reproduce

Link to jsbin

I edited the images and added a space in the URL of the last one - since I could not find an image with spaces in the file name on the open internet to put here. Obviously, that won't work, but we just want to look at the requests made - there will be one to "https://live.staticflickr.com/2660/" and one to "/3715569167_7e978e8319_b.jpg" instead of a single request to "https://live.staticflickr.com/2660/ /3715569167_7e978e8319_b.jpg"

For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

  • Ensure that the reporter has included a reproducible demo. They can easily fork this JSBin demo: http://jsbin.com/fiqugiq
  • The issue has been associated with a corresponding milestone.
  • The commits have been incorporated into the corresponding branches. Bug-fix patches go on
    • master and
    • unstable.
  • The issue has been labelled as a bug, if necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug in the code of Cytoscape.js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions