Skip to content
Snippets Groups Projects
Commit c1883f52 authored by Dave LiPuma's avatar Dave LiPuma
Browse files

#138 - escape html entities in BIO text

parent 44831733
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ const UserSettings = {
data () {
return {
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,
newNoRichText: this.$store.state.users.currentUser.no_rich_text,
newDefaultScope: this.$store.state.users.currentUser.default_scope,
......@@ -287,6 +287,14 @@ const UserSettings = {
logout () {
this.$store.dispatch('logout')
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
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment