Skip to content

Commit a68f99c

Browse files
committed
Refactor docs
1 parent a738928 commit a68f99c

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

readme.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
# hast-util-sanitize [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
22

3-
<!--lint disable heading-increment list-item-spacing-->
4-
53
Sanitize [HAST][].
64

75
## Installation
86

9-
[npm][npm-install]:
7+
[npm][]:
108

119
```bash
1210
npm install hast-util-sanitize
1311
```
1412

1513
## Usage
1614

17-
Dependencies:
18-
1915
```javascript
2016
var h = require('hastscript');
2117
var u = require('unist-builder');
2218
var sanitize = require('hast-util-sanitize');
2319
var toHTML = require('hast-util-to-html');
24-
```
25-
26-
Transform:
2720

28-
```javascript
2921
var tree = h('div', {
3022
onmouseover: 'alert("alpha")'
3123
}, [
@@ -44,11 +36,7 @@ var tree = h('div', {
4436
'xlink:href': 'data:x,<script>alert("foxtrot")</script>'
4537
}))
4638
]);
47-
```
4839

49-
Compile:
50-
51-
```javascript
5240
var unsanitized = toHTML(tree);
5341
var sanitized = toHTML(sanitize(tree));
5442
```
@@ -239,7 +227,7 @@ should however be entirely stripped from the tree.
239227

240228
[codecov]: https://codecov.io/github/wooorm/hast-util-sanitize
241229

242-
[npm-install]: https://docs.npmjs.com/cli/install
230+
[npm]: https://docs.npmjs.com/cli/install
243231

244232
[license]: LICENSE
245233

0 commit comments

Comments
 (0)