fix bio being interpreted as html for editing
This commit is contained in:
parent
2ce11e56d4
commit
98e2a60948
2 changed files with 5 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import isEqual from 'lodash/isEqual'
|
import isEqual from 'lodash/isEqual'
|
||||||
import merge from 'lodash/merge'
|
import merge from 'lodash/merge'
|
||||||
import ldUnescape from 'lodash/unescape'
|
import ldUnescape from 'lodash/unescape'
|
||||||
|
import ldEscape from 'lodash/escape'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||||
|
|
@ -159,6 +160,9 @@ export default {
|
||||||
this.$store.dispatch('fetchUserRelationship', this.user.id)
|
this.$store.dispatch('fetchUserRelationship', this.user.id)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
escapedNewBio() {
|
||||||
|
return ldEscape(this.newBio).replace(/\n/g, '<br>')
|
||||||
|
},
|
||||||
somethingToSave() {
|
somethingToSave() {
|
||||||
if (this.newName !== this.user.name_unescaped) return true
|
if (this.newName !== this.user.name_unescaped) return true
|
||||||
if (this.newBio !== ldUnescape(this.user.description)) return true
|
if (this.newBio !== ldUnescape(this.user.description)) return true
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,7 @@
|
||||||
v-if="!hideBio"
|
v-if="!hideBio"
|
||||||
class="user-card-bio"
|
class="user-card-bio"
|
||||||
:class="{ '-justify-left': mergedConfig.userCardLeftJustify }"
|
:class="{ '-justify-left': mergedConfig.userCardLeftJustify }"
|
||||||
:html="editable ? newBio.replace(/\n/g, '<br>') : user.description_html"
|
:html="editable ? escapedNewBio : user.description_html"
|
||||||
:emoji="editable ? emoji : user.emoji"
|
:emoji="editable ? emoji : user.emoji"
|
||||||
:handle-links="true"
|
:handle-links="true"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue