Skip to content

Commit

Permalink
changes in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gkumar9891 committed Feb 4, 2024
1 parent 54a6ac2 commit b268d15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## UNRELEASED

- Clarified the use of SVGs with a new test and changes to documentation.

## UNRELEASED

- Introduced the `allowedEmptyAttributes` option, enabling explicit specification of empty string values for select attributes, with the default attribute set to `alt`.

## 2.11.0 (2023-06-21)
Expand Down
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -265,6 +265,19 @@ allowedAttributes: {

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.

#### "What if I want to prevent attributes and tags from being truly lowercase?"

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.

```js
allowedTags: [ 'svg', 'g', 'defs', 'linearGradient', 'stop', 'circle' ],
allowedAttributes: false,
parser: {
lowerCaseTags: false,
lowerCaseAttributeNames: false
}
```

### Wildcards for attributes

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

0 comments on commit b268d15

Please sign in to comment.