Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

sanitize-tooltip #134

Merged
merged 1 commit into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"lodash": "^4.17.4",
"moment": "^2.20.1",
"qrious": "^4.0.2",
"sanitize-html": "^1.18.2",
"v-tooltip": "^2.0.0-rc.30",
"vue": "^2.5.13",
"vue-chartjs": "^3.1.0",
Expand Down
10 changes: 9 additions & 1 deletion src/components/links/Transaction.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span v-tooltip="smartBridge">
<span v-tooltip="sanitizedVendorfield">
<router-link :to="{ name: 'transaction', params: { id } }" class="hidden md:inline-block whitespace-no-wrap">
<span v-if="hasDefaultSlot"><slot></slot></span>
<span v-else>{{ truncate(id) }}</span>
Expand All @@ -11,6 +11,8 @@
</template>

<script type="text/ecmascript-6">
import sanitizeHtml from 'sanitize-html'

export default {
props: {
id: {
Expand All @@ -27,6 +29,12 @@ export default {
hasDefaultSlot() {
return !!this.$slots.default
},
sanitizedVendorfield() {
if (this.smartBridge !== undefined) {
return sanitizeHtml(this.smartBridge)
}
return ""
}
},
}
</script>