forked from AkkomaGang/akkoma-fe
#138 - escape html entities in BIO text
This commit is contained in:
parent
448317338e
commit
c1883f5282
1 changed files with 9 additions and 1 deletions
|
@ -6,7 +6,7 @@ const UserSettings = {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
newName: this.$store.state.users.currentUser.name,
|
newName: this.$store.state.users.currentUser.name,
|
||||||
newBio: this.$store.state.users.currentUser.description,
|
newBio: this.parseEntities(this.$store.state.users.currentUser.description),
|
||||||
newLocked: this.$store.state.users.currentUser.locked,
|
newLocked: this.$store.state.users.currentUser.locked,
|
||||||
newNoRichText: this.$store.state.users.currentUser.no_rich_text,
|
newNoRichText: this.$store.state.users.currentUser.no_rich_text,
|
||||||
newDefaultScope: this.$store.state.users.currentUser.default_scope,
|
newDefaultScope: this.$store.state.users.currentUser.default_scope,
|
||||||
|
@ -287,6 +287,14 @@ const UserSettings = {
|
||||||
logout () {
|
logout () {
|
||||||
this.$store.dispatch('logout')
|
this.$store.dispatch('logout')
|
||||||
this.$router.replace('/')
|
this.$router.replace('/')
|
||||||
|
},
|
||||||
|
parseEntities (text) {
|
||||||
|
const parser = new DOMParser
|
||||||
|
const dom = parser.parseFromString(
|
||||||
|
'<!doctype html><body>' + text,
|
||||||
|
'text/html')
|
||||||
|
const decodedText = dom.body.textContent
|
||||||
|
return decodedText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue