From d9779bc6df1ff7820fdf0fae88727ab4f4e23ecb Mon Sep 17 00:00:00 2001 From: koda Date: Tue, 19 Jul 2016 23:12:06 +0900 Subject: [PATCH 1/3] Add test for unc path. --- .../gitbucket/markedj/ExtendParseTest.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java b/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java index 73abda5..a6be262 100644 --- a/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java +++ b/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java @@ -61,6 +61,44 @@ public void testLinkTarget() throws Exception { assertEquals(expect, result); } + + + + @Test + public void testUNC() throws Exception { + Options options = new Options(); + options.setBreaks(true); + options.setLinkTargetBlank(true); + String md = "[UNCPathLink](¥¥hoge¥data \"UNCPathLink\")"; + String result = Marked.marked(md, options); + String expect = "

UNCPathLink

\n"; + assertEquals(expect, result); + } + + @Test + public void testFile() throws Exception { + Options options = new Options(); + options.setBreaks(true); + options.setLinkTargetBlank(true); + String md = "[UNCPathLink](file://hoge/data \"UNCPathLink\")"; + String result = Marked.marked(md, options); + String expect = "

UNCPathLink

\n"; + assertEquals(expect, result); + } + + + @Test + public void testSmb() throws Exception { + Options options = new Options(); + options.setBreaks(true); + options.setLinkTargetBlank(true); + String md = "[UNCPathLink](smb://hoge/data \"UNCPathLink\")"; + String result = Marked.marked(md, options); + String expect = "

UNCPathLink

\n"; + assertEquals(expect, result); + } + + private String loadResourceAsString(String path) throws IOException { InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); try { From e10147c1a8455e5f3e4e13318fa3d4524a37293a Mon Sep 17 00:00:00 2001 From: koda Date: Wed, 20 Jul 2016 19:18:15 +0900 Subject: [PATCH 2/3] fix typo & --- pom.xml | 2 +- src/main/java/io/github/gitbucket/markedj/Utils.java | 2 +- .../io/github/gitbucket/markedj/ExtendParseTest.java | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b54c76c..708646c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.support-project markedj jar - 1.4.0 + 1.5.0-SNAPSHOT markedj https://github.com/gitbucket/markedj Fork from gitbucket markedj because knowledge's issue. markedj is JVM port of graceful markdown processor marked.js diff --git a/src/main/java/io/github/gitbucket/markedj/Utils.java b/src/main/java/io/github/gitbucket/markedj/Utils.java index 9bbc834..979b68b 100644 --- a/src/main/java/io/github/gitbucket/markedj/Utils.java +++ b/src/main/java/io/github/gitbucket/markedj/Utils.java @@ -13,7 +13,7 @@ public static String escape(String html, boolean encode){ if(!encode){ html = html.replaceAll("&(?!#?\\w+;)", "&"); } else { - html = html.replace("&", "&"); + html = html.replace("&", "&"); } return html.replace("<", "<").replace(">", ">").replace("\"", """).replace("'", "'"); } diff --git a/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java b/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java index a6be262..1ff6a38 100644 --- a/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java +++ b/src/test/java/io/github/gitbucket/markedj/ExtendParseTest.java @@ -99,6 +99,15 @@ public void testSmb() throws Exception { } + @Test + public void testAmp() { + String markdown = "```\n&read_data\n```"; + String result = Marked.marked(markdown); + String check = "
&read_data\n
\n"; + org.junit.Assert.assertEquals(check, result); + } + + private String loadResourceAsString(String path) throws IOException { InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); try { From 8d6c901fd282c98ad7f95111f985ccdb501ad532 Mon Sep 17 00:00:00 2001 From: koda Date: Sat, 6 Aug 2016 05:11:53 +0900 Subject: [PATCH 3/3] Release v1.5.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 708646c..6a85604 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.support-project markedj jar - 1.5.0-SNAPSHOT + 1.5.0 markedj https://github.com/gitbucket/markedj Fork from gitbucket markedj because knowledge's issue. markedj is JVM port of graceful markdown processor marked.js