Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</div>
<div class="flex items-center buttons">
<p
v-if="resource.format === 'url'"
v-if="isResourceUrl"
class="fr-col-auto fr-ml-3v fr-m-0 z-2"
>
<BrandedButton
Expand Down Expand Up @@ -220,7 +220,7 @@
>
<div
class="fr-mt-0 markdown fr-text--sm text-mention-grey"
v-html="formatMarkdown(resource.description || '')"

Check warning on line 223 in datagouv-components/src/components/ResourceAccordion/ResourceAccordion.vue

View workflow job for this annotation

GitHub Actions / check-cdata-quality

'v-html' directive can lead to XSS attack
/>
</div>
<div
Expand Down Expand Up @@ -370,6 +370,7 @@
import Preview from './Preview.vue'

const GENERATED_FORMATS = ['parquet', 'pmtiles', 'geojson']
const URL_FORMATS = ['url', 'doi', 'www:link', ' www:link-1.0-http--link', 'www:link-1.0-http--partners', 'www:link-1.0-http--related', 'www:link-1.0-http--samples']

const props = withDefaults(defineProps<{
dataset: Dataset | DatasetV2
Expand Down Expand Up @@ -512,6 +513,8 @@
const resourceContentId = 'resource-' + props.resource.id
const resourceHeaderId = 'resource-' + props.resource.id + '-header'
const resourceTitleId = getResourceTitleId(props.resource)

const isResourceUrl = computed(() => URL_FORMATS.includes(props.resource.format))
</script>

<style scoped>
Expand Down
Loading