From b50a2dc5b2196958919bada110021f2ea2850f15 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 3 May 2017 15:26:35 +0200 Subject: [PATCH] Issue 5121 github links are broken --- .../components/wysiwyg/wysiwyg.service.coffee | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/app/modules/components/wysiwyg/wysiwyg.service.coffee b/app/modules/components/wysiwyg/wysiwyg.service.coffee index 93af9637..6244ddf0 100644 --- a/app/modules/components/wysiwyg/wysiwyg.service.coffee +++ b/app/modules/components/wysiwyg/wysiwyg.service.coffee @@ -79,16 +79,6 @@ class WysiwygService return '[' + title + '](' + link + ')' - - linkTitleWithSpaces: (text) -> - link = /\[[^\]]*\]\(([^\)]*)\)/g # [Title-with-spaces](Title with spaces) - - return text.replace link, (match, p1, offset, str) -> - if p1.indexOf(' ') >= 0 - return match.replace /\(.*\)/, '(' + taiga.slugify(p1) + ')' - else - return match - replaceUrls: (html) -> el = document.createElement( 'html' ) el.innerHTML = html @@ -185,7 +175,7 @@ class WysiwygService autoLinkHTML: (html) -> # override Autolink parser - + matchRegexStr = String(Autolinker.matcher.Mention.prototype.matcherRegexes.twitter) if matchRegexStr.indexOf('.') == -1 matchRegexStr = '@[^\s]{1,50}[^.\s]' @@ -222,8 +212,7 @@ class WysiwygService } text = @.replaceEmojiNameByImgs(text) - text = @.pipeLinks(text) - text = @.linkTitleWithSpaces(text) + text = @.pipeLinks(text) md = window.markdownit({ breaks: true