mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(pronouns) fix links on <PronounsIndexLinks> having too many characters url encoded (any pronouns with groups were affected)
This commit is contained in:
parent
bc113b91af
commit
32504a0cae
@ -2,20 +2,21 @@
|
||||
import { addSlash } from '~/src/helpers.ts';
|
||||
import { addPronounInjectionKey } from '~/src/injectionKeys.ts';
|
||||
|
||||
defineProps<{
|
||||
const props = defineProps<{
|
||||
path: string;
|
||||
}>();
|
||||
|
||||
const addPronoun = inject(addPronounInjectionKey, undefined);
|
||||
|
||||
const config = useConfig();
|
||||
|
||||
const link = computed(() => {
|
||||
return addSlash(`${config.pronouns.prefix || ''}/${props.path.replaceAll(/[^\w`&/|,:]+/g, encodeURIComponent)}`);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<nuxt-link
|
||||
v-if="addPronoun === undefined"
|
||||
:to="addSlash(`${config.pronouns.prefix || ''}/${encodeURIComponent(path)}`)"
|
||||
>
|
||||
<nuxt-link v-if="addPronoun === undefined" :to="link">
|
||||
<slot></slot>
|
||||
</nuxt-link>
|
||||
<template v-else>
|
||||
|
Loading…
x
Reference in New Issue
Block a user