<script lang="ts">
	export let href: string;
	export let text: string;

	try {
		let url = new URL(href);

		switch (url.protocol) {
			case 'javascript:':
				href = '#';
				break;

			default:
				break;
		}
	} catch (error) {
		href = '#';
	}
</script>

<a {href} target="_blank">{text}</a>
