phax / ph-css

Advanced Java CSS 3 parser and builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on parsing url(data:image:...)

eduardcotmrf opened this issue · comments

We are having trouble with some url properties with url(data:image). For example this CSS:

.hamburger {
  | background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath style='fill:#ffffff;' d='M820 500c14 0 26-6 36-16s14-22 14-36c0-14-4-26-14-36-12-10-24-16-36-16 0 0-616 0-616 0-12 0-24 6-36 16-10 10-14 22-14 36s4 26 14 36c10 10 22 16 36 16 0 0 616 0 616 0zM204 602c-12 0-24 4-36 14-10 12-14 24-14 36 0 14 4 26 14 36s22 16 36 16c0 0 616 0 616 0 14 0 26-6 36-16s14-22 14-36c0-12-4-24-14-36-12-10-24-14-36-14 0 0-616 0-616 0zM820 294c14 0 26-4 36-14 10-12 14-24 14-36 0-14-4-26-14-36-12-10-24-16-36-16 0 0-616 0-616 0-12 0-24 6-36 16-10 10-14 22-14 36 0 12 4 24 14 36 10 10 22 14 36 14 0 0 616 0 616 0z'/%3E%3C/svg%3E");
  | background-position: left 6px center;
  | background-repeat: no-repeat;
  | display: block;
  | position: absolute;
  | width: 36px;
  | height: 29px;
  | z-index: 1000;
  | top: 1rem;
  | left: 0.9rem;
  | }

If I convert it and print it. It gets transformed to:

.hamburger {
  background:url("http://localhost.comdata:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath style='fill:#ffffff;' d='M820 500c14 0 26-6 36-16s14-22 14-36c0-14-4-26-14-36-12-10-24-16-36-16 0 0-616 0-616 0-12 0-24 6-36 16-10 10-14 22-14 36s4 26 14 36c10 10 22 16 36 16 0 0 616 0 616 0zM204 602c-12 0-24 4-36 14-10 12-14 24-14 36 0 14 4 26 14 36s22 16 36 16c0 0 616 0 616 0 14 0 26-6 36-16s14-22 14-36c0-12-4-24-14-36-12-10-24-14-36-14 0 0-616 0-616 0zM820 294c14 0 26-4 36-14 10-12 14-24 14-36 0-14-4-26-14-36-12-10-24-16-36-16 0 0-616 0-616 0-12 0-24 6-36 16-10 10-14 22-14 36 0 12 4 24 14 36 10 10 22 14 36 14 0 0 616 0 616 0z'/%3E%3C/svg%3E");
  background-position:left 6px center;
  background-repeat:no-repeat;
  display:block;
  position:absolute;
  width:36px;
  height:29px;
  top:1rem;
  left:0.9rem;
}

Adding the hostname in front of the data:image.

Is this a known bug or something it can be avoided?

Thanks!

sorry about opening this issue, the problem was related to our enviroment.