Skip to content
Permalink
f681d64416
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
21 lines (17 sloc) 502 Bytes
<script lang="ts">
export let href: string;
// rel is passed by MDsveX, but we don't need it, so we just ignore it
// no way to change this behavior atm (https://github.com/pngwn/MDsveX/issues/609)
export let rel: string = "";
rel;
const [ target, _rel ] = (() => {
try {
new URL(href)
return [ '_blank', 'noopener noreferrer' ];
} catch {}
return [];
})();
</script>
<a rel={_rel} {target} {href}>
<slot></slot>
</a>