Don't ignore v-html rule globally.

This commit is contained in:
FireMasterK 2021-10-08 19:35:37 +01:00
parent 51b394751d
commit 12c3807d9a
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
3 changed files with 8 additions and 10 deletions

View file

@ -1,6 +1,4 @@
module.exports = { module.exports = {
extends: ["plugin:vue/vue3-recommended", "plugin:prettier/recommended"], extends: ["plugin:vue/vue3-recommended", "plugin:prettier/recommended"],
rules: { rules: {},
"vue/no-v-html": "off",
},
}; };

View file

@ -6,6 +6,7 @@
<img height="48" width="48" class="uk-border-circle" :src="channel.avatarUrl" />{{ channel.name }} <img height="48" width="48" class="uk-border-circle" :src="channel.avatarUrl" />{{ channel.name }}
</h1> </h1>
<img v-if="channel.bannerUrl" :src="channel.bannerUrl" style="width: 100%" loading="lazy" /> <img v-if="channel.bannerUrl" :src="channel.bannerUrl" style="width: 100%" loading="lazy" />
<!-- eslint-disable-next-line vue/no-v-html -->
<p style="white-space: pre-wrap"><span v-html="purifyHTML(urlify(channel.description))"></span></p> <p style="white-space: pre-wrap"><span v-html="purifyHTML(urlify(channel.description))"></span></p>
<button <button

View file

@ -85,7 +85,8 @@
<a class="uk-button uk-button-small" style="background: #222" @click="showDesc = !showDesc"> <a class="uk-button uk-button-small" style="background: #222" @click="showDesc = !showDesc">
{{ showDesc ? $t("actions.minimize_description") : $t("actions.show_description") }} {{ showDesc ? $t("actions.minimize_description") : $t("actions.show_description") }}
</a> </a>
<p v-show="showDesc" :style="[{ colour: foregroundColor }]" v-html="video.description"></p> <!-- eslint-disable-next-line vue/no-v-html -->
<p v-show="showDesc" :style="[{ colour: foregroundColor }]" v-html="purifyHTML(video.description)"></p>
<div v-if="showDesc && sponsors && sponsors.segments"> <div v-if="showDesc && sponsors && sponsors.segments">
{{ $t("video.sponsor_segments") }}: {{ sponsors.segments.length }} {{ $t("video.sponsor_segments") }}: {{ sponsors.segments.length }}
</div> </div>
@ -280,12 +281,10 @@ export default {
this.channelId = this.video.uploaderUrl.split("/")[2]; this.channelId = this.video.uploaderUrl.split("/")[2];
if (!this.isEmbed) this.fetchSubscribedStatus(); if (!this.isEmbed) this.fetchSubscribedStatus();
this.video.description = this.purifyHTML( this.video.description = this.video.description
this.video.description
.replaceAll("http://www.youtube.com", "") .replaceAll("http://www.youtube.com", "")
.replaceAll("https://www.youtube.com", "") .replaceAll("https://www.youtube.com", "")
.replaceAll("\n", "<br>"), .replaceAll("\n", "<br>");
);
} }
}); });
}, },