-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Following the README instructions, we imported directive AssetsPublicPathDirective into a component to rewrite src/href links that begin with assets/. We found that this directive breaks any href that uses interpolation to set its value to an absolute URL, with the result being that the href attribute is now missing.
For example, if myAbsoluteUrl="https://www.example.com/", the following displays the "My Link" text as not clickable. The href attribute is missing.
<a href="{{ myAbsoluteUrl }}">My Link</a>
The directive only sets the href attribute if the URL was changed by the rewrite. This assumes that otherwise the attribute has already been set for absolute URLs, but that is not the case. If you set a break point on line 23, you can verify that at that point, there is no href attribute listed under this.el.nativeElement. It must be set by the directive regardless of whether the rewritten value has changed or not.
While we were only testing with a[href], this bug may affect all attributes listed in the selector when using interpolation and absolute URLs:
img[src], source[src], link[href], script[src], a[href]