From cfca0e88f1a79941a5d0296a34d44a5567619f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Sat, 15 Mar 2014 21:08:54 +0100 Subject: [PATCH] Revert "Merge pull request #4847 from hincupetru/3692-hashtags-inside-markdown-link" This reverts commit 06ab49862059e5076eb88180e7f182194bcd8ebe, reversing changes made to 3c4d8d95d3a94bc3eec43793982977d50d5854b5. Conflicts: Changelog.md --- Changelog.md | 1 - .../javascripts/app/helpers/text_formatter.js | 15 +++++---------- .../app/helpers/text_formatter_spec.js | 7 ------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Changelog.md b/Changelog.md index 6b210cc67..97b82aeec 100644 --- a/Changelog.md +++ b/Changelog.md @@ -24,7 +24,6 @@ * Fixed Atom Feed Error if reshared Post is deleted [#4638] (https://github.com/diaspora/diaspora/issues/4638) * Show hovercards in the notification drop-down for users on the same pod [#4843](https://github.com/diaspora/diaspora/pull/4843) * The photo stream no longer repeats after the last photo [#4726](https://github.com/diaspora/diaspora/issues/4726) -* Stop parsing hashtags inside markdown links [#3692](https://github.com/diaspora/diaspora/issues/3692) * Fix hovercards in the notificaitons dropdown [#4693](https://github.com/diaspora/diaspora/issues/4693) ## Features diff --git a/app/assets/javascripts/app/helpers/text_formatter.js b/app/assets/javascripts/app/helpers/text_formatter.js index 0ae8e9d5d..3e122d87a 100644 --- a/app/assets/javascripts/app/helpers/text_formatter.js +++ b/app/assets/javascripts/app/helpers/text_formatter.js @@ -108,16 +108,11 @@ $(function() { }; textFormatter.hashtagify = function hashtagify(text){ - var utf8WordCharcters =/(\s|^|>)#([\u0080-\uFFFF|\w|-]+|<3)/g; - var linkRegex = /]*>(.*?)<\/a>/g; - - if(text.match(linkRegex)) - return text; - else - return text.replace(utf8WordCharcters, function(hashtag, preceeder, tagText) { - return preceeder + "#" + tagText + "" - }); + var utf8WordCharcters =/(\s|^|>)#([\u0080-\uFFFF|\w|-]+|<3)/g + return text.replace(utf8WordCharcters, function(hashtag, preceeder, tagText) { + return preceeder + "#" + tagText + "" + }) }; textFormatter.mentionify = function mentionify(text, mentions) { diff --git a/spec/javascripts/app/helpers/text_formatter_spec.js b/spec/javascripts/app/helpers/text_formatter_spec.js index 2c1461b69..29aec511e 100644 --- a/spec/javascripts/app/helpers/text_formatter_spec.js +++ b/spec/javascripts/app/helpers/text_formatter_spec.js @@ -238,13 +238,6 @@ describe("app.helpers.textFormatter", function(){ expect(formattedText).toContain("/tags/parties") }) - - it("doesn't create tag if the text is a link", function(){ - var link = $('', { href: 'http://me.co' }).html('#me')[0].outerHTML; - var result = this.formatter.hashtagify(link); - - expect(result).toEqual(link); - }) }) })