diff --git a/pom.xml b/pom.xml index d4dfd36..e843dad 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ org.jsoup jsoup - 1.10.2 + 1.15.3 junit diff --git a/src/main/java/io/github/gitbucket/markedj/Marked.java b/src/main/java/io/github/gitbucket/markedj/Marked.java index ebb27dd..b266991 100644 --- a/src/main/java/io/github/gitbucket/markedj/Marked.java +++ b/src/main/java/io/github/gitbucket/markedj/Marked.java @@ -1,7 +1,7 @@ package io.github.gitbucket.markedj; import org.jsoup.Jsoup; -import org.jsoup.safety.Whitelist; +import org.jsoup.safety.Safelist; public class Marked { @@ -20,7 +20,7 @@ public static String marked(String src, Options options, Renderer renderer){ Parser parser = new Parser(options, renderer); String html = parser.parse(result.getTokens(), result.getLinks()); - Whitelist whitelist = options.getWhitelist(); + Safelist whitelist = options.getSafelist(); if(whitelist != null) { return Jsoup.clean(html, whitelist); diff --git a/src/main/java/io/github/gitbucket/markedj/Options.java b/src/main/java/io/github/gitbucket/markedj/Options.java index 5e565d2..63b7472 100644 --- a/src/main/java/io/github/gitbucket/markedj/Options.java +++ b/src/main/java/io/github/gitbucket/markedj/Options.java @@ -1,6 +1,6 @@ package io.github.gitbucket.markedj; -import org.jsoup.safety.Whitelist; +import org.jsoup.safety.Safelist; public class Options { @@ -10,7 +10,7 @@ public class Options { private boolean sanitize = false; private String langPrefix = "lang-"; private String headerPrefix = ""; - private Whitelist whitelist = new Whitelist() + private Safelist safelist = new Safelist() .addTags( "a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", @@ -57,8 +57,8 @@ public void setHeaderPrefix(String headerPrefix) { this.headerPrefix = headerPrefix; } - public void setWhitelist(Whitelist whitelist){ - this.whitelist = whitelist; + public void setSafelist(Safelist whitelist){ + this.safelist = safelist; } public boolean isGfm() { @@ -85,8 +85,8 @@ public String getHeaderPrefix() { return headerPrefix; } - public Whitelist getWhitelist(){ - return whitelist; + public Safelist getSafelist(){ + return safelist; } } diff --git a/src/test/java/io/github/gitbucket/markedj/MarkedTest.java b/src/test/java/io/github/gitbucket/markedj/MarkedTest.java index 9651caa..7d09c29 100644 --- a/src/test/java/io/github/gitbucket/markedj/MarkedTest.java +++ b/src/test/java/io/github/gitbucket/markedj/MarkedTest.java @@ -166,10 +166,10 @@ public void testParagraphSeparation() throws Exception { "- List B", new Options()); assertEquals( - "

Message A

\n" + - "