Skip to content

Commit

Permalink
pkp/pkp-lib#9421 replace v-html with v-strip-unsave-html (#324)
Browse files Browse the repository at this point in the history
* pkp/pkp-lib#9421 replace v-html with v-strip-unsave-html

* pkp/pkp-lib#9421 doc tool might require v-html
  • Loading branch information
jardakotesovec authored Feb 9, 2024
1 parent fcebfb3 commit 71ba3d4
Show file tree
Hide file tree
Showing 29 changed files with 98 additions and 53 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"core-js": "^3.8.0",
"debounce": "^1.2.0",
"dedent": "^0.7.0",
"dompurify": "^3.0.8",
"element-resize-event": "^3.0.3",
"highlight.js": "^10.4.1",
"html-entities": "^1.3.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/DateRange/DateRange.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="pkpDateRange">
<span class="-screenReader">{{ dateRangeLabel }}</span>
<span class="pkpDateRange__current" v-html="currentRange" />
<span class="pkpDateRange__current" v-strip-unsafe-html="currentRange" />
<button
class="pkpDateRange__button"
ref="toggleButton"
Expand Down Expand Up @@ -63,7 +63,7 @@
<pkp-button @click="applyCustomRange">{{ applyLabel }}</pkp-button>
<div v-if="errorMessage" class="pkpDateRange__error">
<icon icon="exclamation-triangle" :inline="true" />
<span v-html="errorMessage" />
<span v-strip-unsafe-html="errorMessage" />
</div>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileAttacher/FileAttacher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:id="'attacher' + key"
>
<h2>{{ attacher.label }}</h2>
<p v-html="attacher.description" />
<p v-strip-unsafe-html="attacher.description" />
<template slot="actions">
<pkp-button
:aria-describedby="'attacher' + key"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/FieldError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class="pkpFieldError__message"
>
<icon icon="exclamation-triangle" :inline="true" />
<span v-html="message" />
<span v-strip-unsafe-html="message" />
</div>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/FormGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div
v-if="description"
class="pkpFormGroup__description"
v-html="description"
v-strip-unsafe-html="description"
></div>
</div>
<div class="pkpFormGroup__fields">
Expand Down
6 changes: 3 additions & 3 deletions src/components/Form/fields/FieldArchivingPn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
v-if="tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
Expand All @@ -33,13 +33,13 @@
<div
v-if="description"
class="pkpFormField__description pkpFormField--options__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div
v-if="terms && value"
class="pkpFormField__description pkpFormField--options__description pkpFormField--archivingPn__terms"
v-html="terms"
v-strip-unsafe-html="terms"
/>
<field-error
v-if="errors && errors.length"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldBaseAutosuggest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
v-if="tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
Expand All @@ -34,7 +34,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control pkpAutosuggest__control">
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldColor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
v-if="isPrimaryLocale && tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="isPrimaryLocale && helpTopic"
Expand All @@ -35,7 +35,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control">
Expand Down
8 changes: 6 additions & 2 deletions src/components/Form/fields/FieldHtml.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
{{ label }}
</span>
<tooltip v-if="tooltip" aria-hidden="true" :tooltip="tooltip" label="" />
<span v-if="tooltip" class="-screenReader" v-html="tooltip" />
<span
v-if="tooltip"
class="-screenReader"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
:topic="helpTopic"
Expand All @@ -15,7 +19,7 @@
</div>
<div
class="pkpFormField__control pkpFormField__control--html"
v-html="description"
v-strip-unsafe-html="description"
/>
</div>
</template>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Form/fields/FieldMetadataSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
v-if="tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
Expand All @@ -20,7 +20,7 @@
<div
v-if="description"
class="pkpFormField__description pkpFormField--options__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<field-error
Expand All @@ -45,7 +45,7 @@
/>
<span
class="pkpFormField--options__optionLabel"
v-html="option.label"
v-strip-unsafe-html="option.label"
/>
</label>
<div v-if="isEnabled" class="pkpFormField--metadata__submissionOptions">
Expand All @@ -64,7 +64,7 @@
/>
<span
class="pkpFormField--options__optionLabel"
v-html="option.label"
v-strip-unsafe-html="option.label"
/>
</label>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Form/fields/FieldOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
v-if="isPrimaryLocale && tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="isPrimaryLocale && helpTopic"
Expand All @@ -35,7 +35,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description pkpFormField--options__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control">
Expand Down Expand Up @@ -79,7 +79,7 @@
/>
<span
class="pkpFormField--options__optionLabel"
v-html="option.label"
v-strip-unsafe-html="option.label"
/>
<orderer
v-if="isOrderable"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldPubId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
v-if="tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
Expand All @@ -25,7 +25,7 @@
<div
v-if="description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control">
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldRadioInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
v-if="isPrimaryLocale && tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="isPrimaryLocale && helpTopic"
Expand All @@ -35,7 +35,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description pkpFormField--options__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<field-error
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldRichTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
v-if="isPrimaryLocale && tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="isPrimaryLocale && helpTopic"
Expand All @@ -35,7 +35,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
v-if="tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
Expand All @@ -27,7 +27,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div
Expand Down
6 changes: 3 additions & 3 deletions src/components/Form/fields/FieldSelectIssue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
v-if="tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
Expand All @@ -25,12 +25,12 @@
<div
v-if="description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control">
<span class="pkpFormField__description">
<span v-html="notice" />
<span v-strip-unsafe-html="notice" />
<pkp-button
v-if="button"
v-bind="button"
Expand Down
6 changes: 3 additions & 3 deletions src/components/Form/fields/FieldText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
v-if="isPrimaryLocale && tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="isPrimaryLocale && helpTopic"
Expand All @@ -32,7 +32,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control" :class="controlClasses">
Expand All @@ -53,7 +53,7 @@
<span
v-if="prefix"
class="pkpFormField__inputPrefix"
v-html="prefix"
v-strip-unsafe-html="prefix"
ref="prefix"
:style="prefixStyles"
@click="setFocus"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
v-if="isPrimaryLocale && tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="isPrimaryLocale && helpTopic"
Expand All @@ -32,7 +32,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div class="pkpFormField__control">
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
v-if="tooltip"
class="-screenReader"
:id="describedByTooltipId"
v-html="tooltip"
v-strip-unsafe-html="tooltip"
/>
<help-button
v-if="helpTopic"
Expand All @@ -27,7 +27,7 @@
<div
v-if="isPrimaryLocale && description"
class="pkpFormField__description"
v-html="description"
v-strip-unsafe-html="description"
:id="describedByDescriptionId"
/>
<div
Expand Down
Loading

0 comments on commit 71ba3d4

Please sign in to comment.