Merge pull request #524 from PhallenCassidy/patch-6
No longer escaping command underlines
This commit is contained in:
@@ -49,14 +49,15 @@ public class MarkdownParser {
|
|||||||
public String renderMarkdown(String markdown, boolean shredLinks) {
|
public String renderMarkdown(String markdown, boolean shredLinks) {
|
||||||
String newMsg = markdown.trim().replaceAll("\n\n\n+", "\n\n\n");
|
String newMsg = markdown.trim().replaceAll("\n\n\n+", "\n\n\n");
|
||||||
newMsg = QuoteExtender.matcher(newMsg).replaceAll("$1\n");
|
newMsg = QuoteExtender.matcher(newMsg).replaceAll("$1\n");
|
||||||
//Escaping underscores so that URLs with lots of underscores (i.e. wiki links) aren't mangled
|
|
||||||
// Besides, who uses _this_ instead of *this*?
|
|
||||||
newMsg = newMsg.replace("_", "\\_");
|
|
||||||
|
|
||||||
//Need to preserve any commands being made
|
//Need to preserve any commands being made
|
||||||
if(newMsg.startsWith("/"))
|
if(newMsg.startsWith("/"))
|
||||||
return newMsg;
|
return newMsg;
|
||||||
|
|
||||||
|
//Escaping underscores so that URLs with lots of underscores (i.e. wiki links) aren't mangled
|
||||||
|
// Besides, who uses _this_ instead of *this*?
|
||||||
|
newMsg = newMsg.replace("_", "\\_");
|
||||||
|
|
||||||
|
|
||||||
if(shredLinks) {
|
if(shredLinks) {
|
||||||
newMsg = _noHiddenLinksRenderer.render(_markdownParser.parse(newMsg));
|
newMsg = _noHiddenLinksRenderer.render(_markdownParser.parse(newMsg));
|
||||||
|
|||||||
Reference in New Issue
Block a user