Skip to content

Commit 6bb64ad

Browse files
committed
refactor: replace v-html with v-safe-html
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
1 parent e00b04d commit 6bb64ad

26 files changed

+65
-45
lines changed

eslint.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export default defineConfigWithVueTs(
2626
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
2727
camelcase: 'off',
2828
'no-use-before-define': 'off',
29-
'vue/no-v-html': 'off',
30-
'vue/no-v-text-v-html-on-component': 'off',
3129
'@typescript-eslint/no-explicit-any': 'off',
3230
'@typescript-eslint/no-empty-object-type': 'off'
3331
}

src/components/common/AddInstanceDialog.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@save="addInstance"
1010
>
1111
<v-card-text>
12-
<span v-html="helpTxt" />
12+
<span v-safe-html="helpTxt" />
1313

1414
<v-text-field
1515
v-model="url"
@@ -50,17 +50,17 @@
5050

5151
<v-alert
5252
v-if="error"
53+
v-safe-html="error"
5354
dense
5455
text
5556
type="error"
5657
class="mt-3 mb-2"
57-
v-html="error"
5858
/>
5959

6060
<p
6161
v-if="note"
62+
v-safe-html="note"
6263
class="mb-0"
63-
v-html="note"
6464
/>
6565
</v-card-text>
6666
</app-dialog>

src/components/common/AppWarnings.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<li
1515
v-for="(warning, index) in printerWarnings"
1616
:key="index"
17-
v-html="linkExternalUrls(warning)"
17+
v-safe-html="linkExternalUrls(warning)"
1818
/>
1919
</ul>
2020
</template>
@@ -27,7 +27,7 @@
2727
<li
2828
v-for="(warning, index) in klipperWarnings"
2929
:key="index"
30-
v-html="linkExternalUrls(warning.message)"
30+
v-safe-html="linkExternalUrls(warning.message)"
3131
/>
3232
</ul>
3333
</template>
@@ -40,7 +40,7 @@
4040
<li
4141
v-for="(failedComponent, index) in moonrakerFailedComponents"
4242
:key="index"
43-
v-html="linkExternalUrls(failedComponent)"
43+
v-safe-html="linkExternalUrls(failedComponent)"
4444
/>
4545
</ul>
4646
</template>
@@ -53,16 +53,16 @@
5353
<li
5454
v-for="(warning, index) in moonrakerWarnings"
5555
:key="index"
56-
v-html="linkExternalUrls(warning)"
56+
v-safe-html="linkExternalUrls(warning)"
5757
/>
5858
</ul>
5959
</template>
6060

6161
<div v-if="printerWarnings.length > 0">
62-
<span v-html="printerWarningsTxt" />
62+
<span v-safe-html="printerWarningsTxt" />
6363
</div>
6464
<div v-if="moonrakerFailedComponents.length > 0">
65-
<span v-html="moonrakerFailedComponentsTxt" />
65+
<span v-safe-html="moonrakerFailedComponentsTxt" />
6666
</div>
6767
</v-alert>
6868
</template>

src/components/common/BedScrewsAdjustDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</v-row>
4848
<v-row>
4949
<v-col class="text-subtitle-1 text-center">
50-
<span v-html="$t('app.general.msg.bed_screws_adjust')" />
50+
<span v-safe-html="$t('app.general.msg.bed_screws_adjust')" />
5151
</v-col>
5252
</v-row>
5353

src/components/common/CollapsableCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<template v-if="subTitle || hasSubTitleSlot">
7676
<v-card-subtitle class="py-2">
7777
<slot name="sub-title">
78-
<span v-html="subTitle" />
78+
<span v-safe-html="subTitle" />
7979
</slot>
8080
</v-card-subtitle>
8181

@@ -96,7 +96,7 @@
9696
<template v-if="subTitle || hasSubTitleSlot">
9797
<v-card-subtitle class="py-2">
9898
<slot name="sub-title">
99-
<span v-html="subTitle" />
99+
<span v-safe-html="subTitle" />
100100
</slot>
101101
</v-card-subtitle>
102102

src/components/common/FlashMessage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
top
99
centered
1010
>
11-
<span v-html="text" />
11+
<span v-safe-html="text" />
1212

1313
<template #action="{ attrs }">
1414
<app-btn

src/components/common/KlippyStatusCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
type="error"
2828
class="ma-0"
2929
>
30-
<span v-html="$t('app.general.error.printer_powered_off')" />
30+
<span v-safe-html="$t('app.general.error.printer_powered_off')" />
3131
</v-alert>
3232
</v-col>
3333
<v-col
@@ -40,7 +40,7 @@
4040
type="error"
4141
class="ma-0"
4242
>
43-
<span v-html="klippyStateMessage" />
43+
<span v-safe-html="klippyStateMessage" />
4444
</v-alert>
4545
</v-col>
4646
<v-col

src/components/common/PeripheralsDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
text
7373
class="mt-4 mb-0"
7474
>
75-
<span v-html="$t('app.system_info.msg.canbus_warning')" />
75+
<span v-safe-html="$t('app.system_info.msg.canbus_warning')" />
7676
</v-alert>
7777
</template>
7878

src/components/common/RegisterServiceWorker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
bottom
99
right
1010
>
11-
<span v-html="$t('app.general.msg.needs_refresh')" />
11+
<span v-safe-html="$t('app.general.msg.needs_refresh')" />
1212
<template #action="{ attrs }">
1313
<app-btn
1414
v-bind="attrs"

src/components/layout/AppBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
<v-toolbar-title class="printer-title text--secondary">
2828
<router-link
29+
v-safe-html="instanceName"
2930
:to="{ name: 'home' }"
30-
v-html="instanceName"
3131
/>
3232
</v-toolbar-title>
3333
</div>

0 commit comments

Comments
 (0)