diff --git a/components/Example.vue b/components/Example.vue
index 6cc63156..ee79a7d7 100644
--- a/components/Example.vue
+++ b/components/Example.vue
@@ -5,7 +5,7 @@
{{part.str}}
- ({{ pronoun.canonicalName }})
+ ()
-
+
@@ -179,6 +179,16 @@
.replace(new RegExp('^' + this.$base.replace(/^https?:\/\//, '')), '')
.replace(new RegExp('^/'), '')
);
+
+ if (link === this.config.pronouns.any) {
+ pronounOpinions.push({
+ link,
+ pronoun: link,
+ opinion: this.profile.pronouns[pronoun],
+ });
+ continue;
+ }
+
const pronounEntity = buildPronoun(pronouns, link);
if (pronounEntity) {
@@ -195,6 +205,9 @@
let mainPronoun = buildPronoun(pronouns, this.config.profile.flags.defaultPronoun);
let mainOpinion = -1;
for (let {pronoun, opinion} of this.pronounOpinions) {
+ if (typeof pronoun === 'string') {
+ continue;
+ }
if (opinion === 2) {
opinion = 0.5;
}
diff --git a/routes/profileEditor.vue b/routes/profileEditor.vue
index d5f0da52..0f3a3a94 100644
--- a/routes/profileEditor.vue
+++ b/routes/profileEditor.vue
@@ -243,7 +243,7 @@
this.$router.push(`/@${this.$user().username}`)
},
normalisePronoun(pronoun) {
- const link = decodeURIComponent(
+ return decodeURIComponent(
pronoun
.toLowerCase()
.trim()
@@ -251,11 +251,15 @@
.replace(new RegExp('^' + this.$base.replace(/^https?:\/\//, '')), '')
.replace(new RegExp('^/'), '')
);
-
- return buildPronoun(pronouns, link);
+ },
+ normaliseAndBuildPronoun(pronoun) {
+ return buildPronoun(pronouns, this.normalisePronoun(pronoun));
},
validatePronoun(pronoun) {
- return this.normalisePronoun(pronoun) ? null : 'profile.pronounsNotFound'
+ pronoun = this.normalisePronoun(pronoun);
+ return pronoun === this.config.pronouns.any || buildPronoun(pronouns, pronoun)
+ ? null
+ : 'profile.pronounsNotFound'
},
},
computed: {
@@ -267,7 +271,7 @@
opinion = 0.5;
}
if (opinion > mainOpinion) {
- const p = this.normalisePronoun(pronoun);
+ const p = this.normaliseAndBuildPronoun(pronoun);
if (p) {
mainPronoun = p;
mainOpinion = opinion;