Currently a URL like data:image/svg+xml;base64,foo is considered a relative URL, which means that an image tag like this:
<img src="data:image/svg+xml;base64,foo" />
gets re-written to
<img src="../data:image/svg+xml;base64,foo" />
which of course is not supported by the browser.
This PR fixes this issue by adjusting the absolutePathRegex to consider URLs that start with the format data:image/<image-format>; as absolute as well.
This solution could potentially be expanded to be more general and treat anything that starts with data: as an absolute url. I am unsure about the use cases though, and opted for a less generic solution.
Currently a URL like
data:image/svg+xml;base64,foo
is considered a relative URL, which means that an image tag like this:gets re-written to
which of course is not supported by the browser.
This PR fixes this issue by adjusting the
absolutePathRegex
to consider URLs that start with the formatdata:image/<image-format>;
as absolute as well.This solution could potentially be expanded to be more general and treat anything that starts with
data:
as an absolute url. I am unsure about the use cases though, and opted for a less generic solution.