File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -87,14 +87,17 @@ To extend the standard schema with a few changes, clone `github.json`
87
87
like so:
88
88
89
89
``` js
90
- var h = require (' hastscript' );
91
- var merge = require (' deepmerge' );
92
- var gh = require (' hast-util-sanitize/lib/github' );
90
+ var h = require (' hastscript' )
91
+ var merge = require (' deepmerge' )
92
+ var gh = require (' hast-util-sanitize/lib/github' )
93
+ var sanitize = require (' hast-util-sanitize' )
94
+
95
+ var schema = merge (gh, {attributes: {' *' : [' className' ]}})
93
96
94
- var schema = merge (gh , {attributes : { ' * ' : [ ' className ' ]}});
97
+ var tree = sanitize ( h ( ' div ' , {className : [ ' foo ' ]}), schema)
95
98
96
- var tree = sanitize (h (' div' , {className: [' foo' ]}), schema);
97
99
// `tree` still has `className`.
100
+ console .log (tree)
98
101
```
99
102
100
103
###### ` attributes `
You can’t perform that action at this time.
0 commit comments