Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for video metainfo #2782

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/components/WatchVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,19 @@
</div>
</div>

<hr />
<hr class="mb-2" />

<div
v-for="metaInfo in video?.metaInfo ?? []"
:key="metaInfo.title"
class="btn px-4 py-2 flex flex-wrap gap-2 my-3 cursor-default"
>
<span>{{ metaInfo.description ?? metaInfo.title }}</span>
<a v-for="(link, linkIndex) in metaInfo.urls" :key="linkIndex" :href="link" class="underline">{{
metaInfo.urlTexts[linkIndex]
}}</a>
<br />
</div>

<button
v-t="`actions.${showDesc ? 'minimize_description' : 'show_description'}`"
Expand All @@ -158,9 +170,10 @@
</span>

<!-- eslint-disable-next-line vue/no-v-html -->
<div v-show="showDesc" class="break-words description" v-html="purifiedDescription" />
<template v-if="showDesc">
<div class="break-words description" v-html="purifiedDescription" />

Check warning on line 174 in src/components/WatchVideo.vue

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 'v-html' directive can lead to XSS attack. Raw Output: {"ruleId":"vue/no-v-html","severity":1,"message":"'v-html' directive can lead to XSS attack.","line":174,"column":54,"nodeType":"VAttribute","messageId":"unexpected","endLine":174,"endColumn":82}

Check warning on line 174 in src/components/WatchVideo.vue

View workflow job for this annotation

GitHub Actions / build

'v-html' directive can lead to XSS attack

Check warning on line 174 in src/components/WatchVideo.vue

View workflow job for this annotation

GitHub Actions / build

'v-html' directive can lead to XSS attack
<br />

<div
v-if="sponsors && sponsors.segments"
v-text="`${$t('video.sponsor_segments')}: ${sponsors.segments.length}`"
Expand Down