#Fragment improper tags

13 messages · Page 1 of 1 (latest)

dark elk
#
<Fragment set:html={links} />

The string inside links evals to

<link
    rel="stylesheet"
    type="text/css"
    href="/Font/AlbertSans500.css"
/>
<link
    rel="stylesheet"
    type="text/css"
    href="/Font/AlbertSans600.css"
/>
<link
    rel="stylesheet"
    type="text/css"
    href="/Font/AlbertSans700.css"
/>
<link
    rel="stylesheet"
    type="text/css"
    href="/Font/AlbertSans800.css"
/>
<link
    rel="stylesheet"
    type="text/css"
    href="/Font/AlbertSans900.css"
/>

but the content produced is <link ="" and then the rest of the tag which is invalid HTML, am I missing a property on the HTML tag perhaps?

viral trench
#

The string you're showing us doesn't match what's displayed ?

dark elk
#

yes the type="text/css" is removed in the screenshot but that doesn't matter

#

that's because I tried it differently

#

the ="" is still being added, regardless

#

now that I think of it it could be because of the astro-capo integration

viral trench
#

Well it matters because your string is likely malformed unless something else mess with it

#

If I use

let links = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/Font/AlbertSans500.css\" />"

along with
<Fragment set:html={links} />

dark elk
#

no I mean, I took the screenshot after I removed it from the match

viral trench
#

Then I get

dark elk
#

I have this

const Link = (Link: string[] = []) =>
    Link.map(
        (Link) => `<link
            rel="stylesheet"
            type="text/css"
            href="${Link}"
        />`
    ).join("\n");

generating links

#

the screenshot was taken after I removed type="text/css" that's why it doesn't matter

#

that's not the issue