From 2694044566a28eff4dfe1ec4af7a946d28a78791 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 18 Sep 2015 08:19:36 -0400 Subject: [PATCH] Update to Pegdown 1.5.0 --- .classpath | 14 +++---- build.moxie | 2 +- gitblit.iml | 42 +++++++++---------- .../java/com/gitblit/utils/MarkdownUtils.java | 3 +- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.classpath b/.classpath index bd0b4372..9eaa7e43 100644 --- a/.classpath +++ b/.classpath @@ -28,13 +28,13 @@ - - - - - - - + + + + + + + diff --git a/build.moxie b/build.moxie index 311e26df..8d92fda0 100644 --- a/build.moxie +++ b/build.moxie @@ -148,7 +148,7 @@ dependencies: - compile 'org.apache.lucene:lucene-highlighter:${lucene.version}' :war :fedclient - compile 'org.apache.lucene:lucene-memory:${lucene.version}' :war :fedclient - compile 'org.apache.lucene:lucene-queryparser:${lucene.version}' :war :fedclient -- compile 'org.pegdown:pegdown:1.4.2' :war +- compile 'org.pegdown:pegdown:1.5.0' :war - compile 'org.fusesource.wikitext:wikitext-core:${wikitext.version}' :war - compile 'org.fusesource.wikitext:twiki-core:${wikitext.version}' :war - compile 'org.fusesource.wikitext:textile-core:${wikitext.version}' :war diff --git a/gitblit.iml b/gitblit.iml index 343f24e4..55903760 100644 --- a/gitblit.iml +++ b/gitblit.iml @@ -265,79 +265,79 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/main/java/com/gitblit/utils/MarkdownUtils.java b/src/main/java/com/gitblit/utils/MarkdownUtils.java index 2ebfdb26..e0c9dd4e 100644 --- a/src/main/java/com/gitblit/utils/MarkdownUtils.java +++ b/src/main/java/com/gitblit/utils/MarkdownUtils.java @@ -16,6 +16,7 @@ package com.gitblit.utils; import static org.pegdown.Extensions.ALL; +import static org.pegdown.Extensions.ANCHORLINKS; import static org.pegdown.Extensions.SMARTYPANTS; import java.io.IOException; @@ -76,7 +77,7 @@ public class MarkdownUtils { */ public static String transformMarkdown(String markdown, LinkRenderer linkRenderer) { try { - PegDownProcessor pd = new PegDownProcessor(ALL & ~SMARTYPANTS); + PegDownProcessor pd = new PegDownProcessor(ALL & ~SMARTYPANTS & ~ANCHORLINKS); RootNode astRoot = pd.parseMarkdown(markdown.toCharArray()); return new WorkaroundHtmlSerializer(linkRenderer == null ? new LinkRenderer() : linkRenderer).toHtml(astRoot); } catch (ParsingTimeoutException e) { -- 2.39.5