Skip to content

Commit

Permalink
Merge pull request #6 from fhemberger/umd
Browse files Browse the repository at this point in the history
Add AMD support
  • Loading branch information
fhemberger committed Mar 1, 2014
2 parents 9aeba50 + 98f3b67 commit ea00a5f
Show file tree
Hide file tree
Showing 4 changed files with 312 additions and 275 deletions.
17 changes: 17 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"browser": true,
"curly": true,
"eqeqeq": true,
"expr": true,
"laxbreak": true,
"smarttabs": true,
"strict": true,
"undef": true,
"unused": true,
"globals": {
"Attr": false,
"define": false,
"DocumentFragment": false,
"HTMLCollection": false
}
}
11 changes: 0 additions & 11 deletions .project

This file was deleted.

13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ DOMPurify sanitizes HTML and prevents XSS attacks. You can feed DOMPurify with s

### How do I use it?

It's easy. Just include DOMPurify on your website. Afterwards you can sanitiize strings by executing the following code:
It's easy. Just include DOMPurify on your website. Afterwards you can sanitize strings by executing the following code:

```javascript
var clean = DOMPurify.sanitize(dirty);
```

If you're using an [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) module loader like [Require.js](http://requirejs.org/), you can load this script asynchronous as well:

```javascript
require(['dompurify'], function(DOMPurify) {
var clean = DOMPurify.sanitize(dirty);
};
```
### Is there a demo?
Of course there is a demo! [Play with DOMPurify](https://cure53.de/purify)
Expand All @@ -25,7 +34,7 @@ DOMPurify currently supports HTML5, SVG and MathML. DOMPurify per default allows
### Can I configure it?
Yes. The included default configuartion values are pretty good already - but you can of course override them:
Yes. The included default configuration values are pretty good already - but you can of course override them:
```javascript
// Allow only <b>
Expand Down
Loading

0 comments on commit ea00a5f

Please sign in to comment.