From ff09134479808e0ba93542ddecb4a7b79ca89447 Mon Sep 17 00:00:00 2001 From: jeena Date: Wed, 4 Sep 2013 22:25:56 +0200 Subject: [PATCH] using tent-markdown-js now --- WebKit/scripts/helper/Core.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index fe28939..f293603 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -3,11 +3,12 @@ define([ "helper/APICalls", "lib/URI", "helper/HostApp", + "lib/Markdown", "lib/Timeago", "lib/SingleDoubleClick" ], -function(jQuery, APICalls, URI, HostApp) { +function(jQuery, APICalls, URI, HostApp, Markdown) { function Core() { this.saveScrollTop = 0; @@ -660,14 +661,8 @@ function(jQuery, APICalls, URI, HostApp) { } Core.prototype.replaceURLWithHTMLLinks = function(text, entities, message_node) { - // FIXME: this has to be done better so one can nest that stuff and escape with \ - return text.replace(/_([^_]+)_/g, "$1") - .replace(/\*([^\*]+)\*/g, "$1") - .replace(/`([^`]+)`/g, "$1") - .replace(/~([^~]+)~/g, "$1") - .replace(/\#([^\s]+)/g, "#$1") - .replace(/(^|[^\^])\[([^\]]+)\]\(([^\)]+)\)/g, "$1$2") - .replace(/\^\[([^\]]+)\]\((\d+)\)/g, "$1"); + return Markdown.toHTML( text, 'Tent', { footnotes: entities } ) + .replace(/\^