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 merge from 'lodash/merge'
|
||||
import ldUnescape from 'lodash/unescape'
|
||||
import ldEscape from 'lodash/escape'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||
|
|
@ -159,6 +160,9 @@ export default {
|
|||
this.$store.dispatch('fetchUserRelationship', this.user.id)
|
||||
},
|
||||
computed: {
|
||||
escapedNewBio() {
|
||||
return ldEscape(this.newBio).replace(/\n/g, '<br>')
|
||||
},
|
||||
somethingToSave() {
|
||||
if (this.newName !== this.user.name_unescaped) return true
|
||||
if (this.newBio !== ldUnescape(this.user.description)) return true
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@
|
|||
v-if="!hideBio"
|
||||
class="user-card-bio"
|
||||
: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"
|
||||
:handle-links="true"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue