@@ -6,7 +6,7 @@ protecting against XSS.
6
6
7
7
The existing dependencies are on guava and JSR 305. The other jars
8
8
are only needed by the test suite. The JSR 305 dependency is a
9
- compile-only dependency, only needed for annotations.
9
+ compile-only dependency, only needed for annotations.
10
10
11
11
This code was written with security best practices in mind, has an
12
12
extensive test suite, and has undergone
@@ -18,7 +18,7 @@ extensive test suite, and has undergone
18
18
how to get started with or without Maven.
19
19
20
20
You can use
21
- [ prepackaged policies] ( https ://rawgit. com/OWASP/ java-html-sanitizer/master/distrib/javadoc /org/owasp/html/Sanitizers.html) :
21
+ [ prepackaged policies] ( http ://static.javadoc.io/ com.googlecode.owasp-java-html-sanitizer/owasp- java-html-sanitizer/latest /org/owasp/html/Sanitizers.html) :
22
22
23
23
``` Java
24
24
PolicyFactory policy = Sanitizers . FORMATTING. and(Sanitizers . LINKS );
@@ -28,7 +28,7 @@ String safeHTML = policy.sanitize(untrustedHTML);
28
28
or the
29
29
[ tests] ( https://github.com/OWASP/java-html-sanitizer/blob/master/src/test/java/org/owasp/html/HtmlPolicyBuilderTest.java )
30
30
show how to configure your own
31
- [ policy] ( https ://rawgit. com/OWASP/ java-html-sanitizer/master/distrib/javadoc /org/owasp/html/HtmlPolicyBuilder.html) :
31
+ [ policy] ( http ://static.javadoc.io/ com.googlecode.owasp-java-html-sanitizer/owasp- java-html-sanitizer/latest /org/owasp/html/HtmlPolicyBuilder.html) :
32
32
33
33
``` Java
34
34
PolicyFactory policy = new HtmlPolicyBuilder ()
@@ -41,7 +41,7 @@ String safeHTML = policy.sanitize(untrustedHTML);
41
41
```
42
42
43
43
or you can write
44
- [ custom policies] ( https ://rawgit. com/OWASP/ java-html-sanitizer/master/distrib/javadoc /org/owasp/html/ElementPolicy.html)
44
+ [ custom policies] ( http ://static.javadoc.io/ com.googlecode.owasp-java-html-sanitizer/owasp- java-html-sanitizer/latest /org/owasp/html/ElementPolicy.html)
45
45
to do things like changing ` h1 ` s to ` div ` s with a certain class:
46
46
47
47
``` Java
@@ -59,11 +59,11 @@ PolicyFactory policy = new HtmlPolicyBuilder()
59
59
String safeHTML = policy. sanitize(untrustedHTML);
60
60
```
61
61
62
- ```
63
- Please note that the elements "a", "font", "img", "input" and "span" need to be explicitly whitelisted
64
- using the `allowWithoutAttributes()` method if you want them to be allowed through the filter when
65
- these elements do not include any attributes.
66
- ```
62
+ Please note that the elements "a", "font", "img", "input" and "span"
63
+ need to be explicitly whitelisted using the ` allowWithoutAttributes() `
64
+ method if you want them to be allowed through the filter when these
65
+ elements do not include any attributes.
66
+
67
67
----
68
68
69
69
Subscribe to the
0 commit comments