mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 20:54:48 -04:00
(profile) strictly validate any pronoun groups
This commit is contained in:
parent
27cbf91e04
commit
eb2c455de2
@ -313,7 +313,7 @@
|
||||
|
||||
<script>
|
||||
import {head, buildList, buildDict, isValidLink} from "../src/helpers";
|
||||
import { pronouns } from '../src/data';
|
||||
import { pronouns, pronounLibrary } from '../src/data';
|
||||
import { buildPronoun } from "../src/buildPronoun";
|
||||
import config from '../data/config.suml';
|
||||
import link from '../plugins/link';
|
||||
@ -542,14 +542,18 @@
|
||||
if (!pronoun) {
|
||||
return 'profile.pronounsNotFound';
|
||||
}
|
||||
return pronoun === this.config.pronouns.any
|
||||
|| pronoun.startsWith(this.config.pronouns.any + ':')
|
||||
return this.validateAnyPronoun(pronoun)
|
||||
|| (this.config.pronouns.null && this.config.pronouns.null.routes && this.config.pronouns.null.routes.includes(pronoun))
|
||||
|| (this.config.pronouns.mirror && this.config.pronouns.mirror.route === pronoun)
|
||||
|| buildPronoun(pronouns, pronoun)
|
||||
? null
|
||||
: 'profile.pronounsNotFound'
|
||||
},
|
||||
validateAnyPronoun(pronoun) {
|
||||
const prefix = `${this.config.pronouns.any}:`;
|
||||
return pronoun === this.config.pronouns.any
|
||||
|| pronoun.startsWith(prefix) && pronounLibrary.byKey()[pronoun.substring(prefix.length)];
|
||||
},
|
||||
async resetWords() {
|
||||
await this.$confirm();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user