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