Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit b268d15

Browse files
committed
changes in documentation
1 parent 54a6ac2 commit b268d15

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## UNRELEASED
44

5+
- Clarified the use of SVGs with a new test and changes to documentation.
6+
7+
## UNRELEASED
8+
59
- Introduced the `allowedEmptyAttributes` option, enabling explicit specification of empty string values for select attributes, with the default attribute set to `alt`.
610

711
## 2.11.0 (2023-06-21)

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,19 @@ allowedAttributes: {
265265

266266
With `multiple: true`, several allowed values may appear in the same attribute, separated by spaces. Otherwise the attribute must exactly match one and only one of the allowed values.
267267

268+
#### "What if I want to prevent attributes and tags from being truly lowercase?"
269+
270+
if you got any tag like `linearGradient` and you want to prevent that tag from being lowercased so you have to pass `lowerCaseTags: false` in `parser` option and same for if you want to prevent any attribute like `viewBox` in svg tag from being lowercased so you have to pass `lowerCaseAttributeNames: false` in parser option.
271+
272+
```js
273+
allowedTags: [ 'svg', 'g', 'defs', 'linearGradient', 'stop', 'circle' ],
274+
allowedAttributes: false,
275+
parser: {
276+
lowerCaseTags: false,
277+
lowerCaseAttributeNames: false
278+
}
279+
```
280+
268281
### Wildcards for attributes
269282

270283
You can use the `*` wildcard to allow all attributes with a certain prefix:

0 commit comments

Comments
 (0)