-
Notifications
You must be signed in to change notification settings - Fork 14
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(components): use base tag href if defined for post-icon #4217
base: release/v7
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: ac411e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Related Previews |
Quality Gate passedIssues Measures |
@@ -131,7 +131,8 @@ export class PostIcon { | |||
.querySelector('meta[name="design-system-settings"][data-post-icon-base]') | |||
?.getAttribute('data-post-icon-base') ?? null; | |||
|
|||
const fileBase = `${this.base ?? metaBase ?? CDN_URL}/`.replace(/\/\/$/, '/'); | |||
const baseHref = document.getElementsByTagName('base')[0]?.href; | |||
const fileBase = `${this.base ?? metaBase ?? baseHref ?? CDN_URL}/`.replace(/\/\/$/, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set a base tag, you expect the base URL to be use for all relative URLs in the code. Therefore the baseHref
should not replace the icon base path but it should be added to the metaBase
or to this.base
if they are relative.
c56c93d
to
52277d7
Compare
No description provided.