sprintify-ui 0.12.24 → 0.12.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/sprintify-ui.es.js +12252 -11336
- package/dist/types/directives/safeHtml.d.ts +4 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +2 -1
- package/src/components/BaseButton.vue +2 -1
- package/src/components/BaseDataIteratorSectionColumns.vue +2 -1
- package/src/components/BaseDataTableTemplate.vue +2 -1
- package/src/components/BaseDialog.vue +2 -1
- package/src/components/BaseLayoutNotificationItemContent.vue +2 -1
- package/src/components/BaseTableHeader.vue +2 -1
- package/src/components/BaseTooltip.vue +2 -1
- package/src/directives/safeHtml.ts +28 -0
- package/src/index.ts +5 -0
package/README.md
CHANGED
|
@@ -227,6 +227,22 @@ All components are globally available, you can use them without importation:
|
|
|
227
227
|
</script>
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
+
## Rendering HTML safely
|
|
231
|
+
|
|
232
|
+
Never use `v-html` with user-provided content. Use the `v-safe-html` directive instead — it sanitizes the value with [DOMPurify](https://github.com/cure53/DOMPurify) before rendering, stripping scripts, event handlers, `javascript:` URLs, iframes and form elements while keeping rich-text output (links, images, highlights, sub/superscript) intact.
|
|
233
|
+
|
|
234
|
+
The directive is registered globally by the plugin, so migration is mechanical:
|
|
235
|
+
|
|
236
|
+
```html
|
|
237
|
+
<!-- Before -->
|
|
238
|
+
<div v-html="description" />
|
|
239
|
+
|
|
240
|
+
<!-- After -->
|
|
241
|
+
<div v-safe-html="description" />
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
The directive (`vSafeHtml`) and its DOMPurify config (`SAFE_HTML_CONFIG`) are also exported for use outside templates.
|
|
245
|
+
|
|
230
246
|
|
|
231
247
|
## Make changes
|
|
232
248
|
|