From 2dd3a16a181ef93f420af7ffa710a7e0f0d25d80 Mon Sep 17 00:00:00 2001 From: Avris Date: Fri, 19 Mar 2021 20:34:34 +0100 Subject: [PATCH] - disallow passing value by innerHTML (not reactive and missing whitespaces) --- components/Authors.vue | 4 ++-- components/Dictionary.vue | 22 +++++++++++----------- components/Example.vue | 2 +- components/Flag.vue | 4 ++-- components/Header.vue | 6 +++--- components/Opinion.vue | 16 ++++++++-------- components/SimplePronounList.vue | 6 +++--- components/Source.vue | 4 ++-- components/Spelling.vue | 15 ++------------- routes/homepage.vue | 16 ++++++++-------- routes/profile.vue | 2 +- routes/pronoun.vue | 19 ++++++++----------- 12 files changed, 51 insertions(+), 65 deletions(-) diff --git a/components/Authors.vue b/components/Authors.vue index 40e2a9d5..789f3383 100644 --- a/components/Authors.vue +++ b/components/Authors.vue @@ -9,7 +9,7 @@
  • - {{author.name}} +
  • @@ -18,7 +18,7 @@ diff --git a/components/SimplePronounList.vue b/components/SimplePronounList.vue index 036a1094..0159c1fa 100644 --- a/components/SimplePronounList.vue +++ b/components/SimplePronounList.vue @@ -2,12 +2,12 @@
    • - {{pronoun.replace(/&/g, ' ' + $t('pronouns.or') + ' ')}} + - {{pronoun.name(glue)}}/{{pronoun.morphemes[pronoun.smallForm]}} + / – - {{pronoun.description}} +
    • diff --git a/components/Source.vue b/components/Source.vue index 95f1221c..3725388a 100644 --- a/components/Source.vue +++ b/components/Source.vue @@ -2,7 +2,7 @@

      - {{source.author.replace('^', '')}}, {{source.year}} + {{source.author.replace('^', '')}}, {{source.year}}

      • @@ -50,7 +50,7 @@
      • - {{p}} +
      • diff --git a/components/Spelling.vue b/components/Spelling.vue index 1ca14454..ee55ab45 100644 --- a/components/Spelling.vue +++ b/components/Spelling.vue @@ -4,21 +4,10 @@ export default { mixins: [ spelling ], props: { - text: {}, + text: { required: true }, }, render(h) { - return h('span', {domProps: { innerHTML: this.handleSpelling(this.val) }}); + return h('span', {domProps: { innerHTML: this.handleSpelling(this.text) }}); }, - computed: { - val() { - if (this.text !== undefined) { - return this.text; - } - if (this.$slots.default && this.$slots.default.length) { - return this.$slots.default[0].text; - } - return '' - } - } } diff --git a/routes/homepage.vue b/routes/homepage.vue index f3467671..2a3e9ae3 100644 --- a/routes/homepage.vue +++ b/routes/homepage.vue @@ -24,7 +24,7 @@
        • - {{ group.name }} +

          @@ -34,7 +34,7 @@
        • - {{ config.pronouns.multiple.name }} +

          @@ -57,7 +57,7 @@
        @@ -70,7 +70,7 @@
      • - {{ config.pronouns.null.description }} +

        @@ -83,7 +83,7 @@
      • - {{ config.pronouns.emoji.description }} +

        @@ -120,7 +120,7 @@
      @@ -128,7 +128,7 @@

      - {{ selectedPronoun.name(glue) }} +
      - {{part.str}} +

    diff --git a/routes/profile.vue b/routes/profile.vue index 662ec13d..b740dc2e 100644 --- a/routes/profile.vue +++ b/routes/profile.vue @@ -33,7 +33,7 @@

    - {{ line }} +

    diff --git a/routes/pronoun.vue b/routes/pronoun.vue index 78f5090d..36555f5d 100644 --- a/routes/pronoun.vue +++ b/routes/pronoun.vue @@ -16,21 +16,18 @@

    - - ({{Array.isArray(selectedPronoun.description) + ()

    @@ -68,7 +65,7 @@
    • - {{ pronounGroup.group.name }} +

      @@ -77,12 +74,12 @@
      • - {{pronoun.replace(/&/g, ' ' + $t('pronouns.or') + ' ')}} + - {{pronoun.name(glue)}}/{{pronoun.morphemes[pronoun.smallForm]}} + / – - {{pronoun.description}} +