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

fix: make some more cleanup with now optional DOMPurify #1508

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/column-functionalities/Formatters.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Since version 4.x, you can now also return native DOM element instead of an HTML
2. Performance (the reasons are similar to point 1.)
- since it's native it can be appended directly to the grid cell
- when it's an HTML string, it has to do 2 extra steps (which is an overhead process)
i. sanitize the string (we use [DOMPurify](https://github.com/cure53/DOMPurify) by default)
i. sanitize the string (when a sanitizer, for example [DOMPurify](https://github.com/cure53/DOMPurify))
ii. SlickGrid then has to convert it to native element by using `innerHTML` on the grid cell

Demo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,3 @@ this.columnDefinitions = [
}
];
```

### Change Default DOMPurify Options (sanitize html)
If you find that the HTML that you passed is being sanitized and you wish to change it, then you can change the default `sanitizeHtmlOptions` property defined in the Global Grid Options, for more info on how to change these global options, see the `Global Grid Options` and also take a look at the [GitHub - DOMPurify](https://github.com/cure53/DOMPurify#can-i-configure-it) configurations.
4 changes: 0 additions & 4 deletions docs/column-functionalities/filters/Select-Filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,6 @@ this.columnDefinitions = [
];
```

#### Change Default DOMPurify Options (sanitize html)
If you find that the HTML that you passed is being sanitized and you wish to change it, then you can change the default `sanitizeHtmlOptions` property defined in the Global Grid Options, for more info on how to change these [global options](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/global-grid-options.ts).


### Collection Add Blank Entry
In some cases a blank entry at the beginning of the collection could be useful, the most common example for this is to use the first option as a blank entry to tell our Filter to show everything. So for that we can use the `addBlankEntry` flag in `collectionOptions

Expand Down
1 change: 0 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"@slickgrid-universal/binding": "workspace:~",
"@slickgrid-universal/event-pub-sub": "workspace:~",
"@slickgrid-universal/utils": "workspace:~",
"@types/dompurify": "^3.0.5",
"@types/sortablejs": "^1.15.8",
"autocompleter": "^9.2.1",
"dequal": "^2.0.3",
Expand Down
3 changes: 0 additions & 3 deletions packages/custom-tooltip-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,5 @@ export class MyExample {
### Internal Dependencies
- [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common)

### External Dependencies
- [DOM Purify](https://github.com/cure53/DOMPurify) to sanitize HTML text

### Installation
Follow the instruction provided in the main [README](https://github.com/ghiscoding/slickgrid-universal#installation)
3 changes: 0 additions & 3 deletions packages/custom-tooltip-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,5 @@
"dependencies": {
"@slickgrid-universal/common": "workspace:~",
"@slickgrid-universal/utils": "workspace:~"
},
"devDependencies": {
"@types/dompurify": "^3.0.5"
}
}
8 changes: 1 addition & 7 deletions pnpm-lock.yaml

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

Loading