Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.19.1</version>
<version>1.23.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
16 changes: 9 additions & 7 deletions src/test/java/io/github/gitbucket/markedj/MarkedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void testReflink() throws Exception {
@Test
public void testIns() throws Exception {
String result = Marked.marked("~~123~~");
assertEquals("<p>\n <del>123</del></p>", result);
assertEquals("<p><del>123</del></p>", result);
}

@Test
Expand Down Expand Up @@ -121,7 +121,7 @@ public void testBreaks() throws Exception {
//options.setGfm(true); // default is true
String result = Marked.marked(md, options);

assertEquals("<p>first line<br>\n second line</p>", result);
assertEquals("<p>first line\n <br>\n second line</p>", result);
}
}

Expand Down Expand Up @@ -232,8 +232,10 @@ public void testSanitize() throws Exception {
String result = Marked.marked("- <b>test", options);
// It's not clean but tag is closed at least.
assertEquals("<ul>\n" +
" <li><b>test</b></li><b> </b>\n" +
"</ul><b> </b>", result);
" <li><b>test</b></li>\n" +
" <b> </b>\n" +
"</ul>\n" +
"<b> </b>", result);
}
}

Expand Down Expand Up @@ -269,7 +271,7 @@ private String loadResourceAsString(String path) throws IOException {
public void testHardLineBreakWithSpaces() {
String result = Marked.marked("Line 1 \n" +
"Line 2");
assertEquals("<p>Line 1<br>\n" +
assertEquals("<p>Line 1\n <br>\n" +
" Line 2</p>", result);
}

Expand All @@ -286,7 +288,7 @@ public void testStyleAttributeRejectsArbitraryCss() throws Exception {
String result = Marked.marked(
"<div style=\"position:fixed;top:0;left:0;width:100%;height:100%;" +
"background:url(javascript:alert(1))\">clickjack</div>");
assertEquals("<div>\n clickjack\n</div>", result);
assertEquals("<div>clickjack</div>", result);
}

// The fix for the above must not break the one legitimate use of `style`:
Expand All @@ -302,7 +304,7 @@ public void testStyleAttributeAllowsTableAlignment() throws Exception {
public void testHardLineBreakWithBackslash() {
String result = Marked.marked("Line 1\\\n" +
"Line 2");
assertEquals("<p>Line 1<br>\n" +
assertEquals("<p>Line 1\n <br>\n" +
" Line 2</p>", result);
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/gitbucket.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ <h2 id="installation">Installation</h2>
<ol>
<li>Download latest <strong>gitbucket.war</strong> from <a href="https://github.com/takezoe/gitbucket/releases">the release page</a>.</li>
<li>Deploy it to the Servlet 3.0 container such as Tomcat 7.x, Jetty 8.x, GlassFish 3.x or higher.</li>
<li>Access <strong><a href="http://[hostname]:[port]/gitbucket/">http://[hostname]:[port]/gitbucket/</a></strong> using your web browser.</li>
<li>Access <strong><a>http://[hostname]:[port]/gitbucket/</a></strong> using your web browser.</li>
</ol>
<p>If you are using Gitbucket behind a webserver please make sure you have increased the <strong>client_max_body_size</strong> (on nginx)</p>
<p>The default administrator account is <strong>root</strong> and password is <strong>root</strong>.</p>
<p>or you can start GitBucket by <code>java -jar gitbucket.war</code> without servlet container. In this case, GitBucket URL is <strong><a href="http://[hostname]:8080/">http://[hostname]:8080/</a></strong>. You can specify following options.</p>
<p>or you can start GitBucket by <code>java -jar gitbucket.war</code> without servlet container. In this case, GitBucket URL is <strong><a>http://[hostname]:8080/</a></strong>. You can specify following options.</p>
<ul>
<li>--port=[NUMBER]</li>
<li>--prefix=[CONTEXTPATH]</li>
Expand Down
Loading