Skip to content

Commit 3a04b9e

Browse files
Version Packages (#600)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 62a16f3 commit 3a04b9e

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

.changeset/nasty-knives-attack.md

-5
This file was deleted.

.changeset/tricky-poems-collect.md

-24
This file was deleted.
Binary file not shown.

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# markdown-to-jsx
22

3+
## 7.5.0
4+
5+
### Minor Changes
6+
7+
- 62a16f3: Allow modifying HTML attribute sanitization when `options.sanitizer` is passed by the composer.
8+
9+
By default a lightweight URL sanitizer function is provided to avoid common attack vectors that might be placed into the `href` of an anchor tag, for example. The sanitizer receives the input, the HTML tag being targeted, and the attribute name. The original function is available as a library export called `sanitizer`.
10+
11+
This can be overridden and replaced with a custom sanitizer if desired via `options.sanitizer`:
12+
13+
```jsx
14+
// sanitizer in this situation would receive:
15+
// ('javascript:alert("foo")', 'a', 'href')
16+
17+
;<Markdown options={{ sanitizer: (value, tag, attribute) => value }}>
18+
{`[foo](javascript:alert("foo"))`}
19+
</Markdown>
20+
21+
// or
22+
23+
compiler('[foo](javascript:alert("foo"))', {
24+
sanitizer: (value, tag, attribute) => value,
25+
})
26+
```
27+
28+
### Patch Changes
29+
30+
- 553a175: Replace RuleType enum with an object
31+
332
## 7.4.7
433

534
### Patch Changes

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Convert markdown to JSX with ease for React and React-like projects. Super lightweight and highly configurable.",
44
"homepage": "https://markdown-to-jsx.quantizor.dev",
55
"license": "MIT",
6-
"version": "7.4.7",
6+
"version": "7.5.0",
77
"publishConfig": {
88
"access": "public"
99
},

0 commit comments

Comments
 (0)