Skip to content
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

addCustomAttribute not working on MetaLinks #105

Open
0xTim opened this issue Aug 7, 2024 · 0 comments
Open

addCustomAttribute not working on MetaLinks #105

0xTim opened this issue Aug 7, 2024 · 0 comments

Comments

@0xTim
Copy link
Contributor

0xTim commented Aug 7, 2024

When using addCustomAttribute on a MetaLink, e.g.

MetaLink(href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css", rel: "stylesheet")
    .addCustomAttribute(name: "integrity", value: "sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH")
    .addCustomAttribute(name: "crossorigin", value: "anonymous")

I would expect the output to be

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

However, it is only generating

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">

The same code with a Script for example works:

Script(file: "https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js")
    .addCustomAttribute(name: "integrity", value: "sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r")
    .addCustomAttribute(name: "crossorigin", value: "anonymous")

Generates correctly:

<script integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant