Loading Changelog.md +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ * Remove whitespace from author link [#7330](https://github.com/diaspora/diaspora/pull/7330) * Fix autosize in modals [#7339](https://github.com/diaspora/diaspora/pull/7339) * Only display invite link on contacts page if invitations are enabled [#7342](https://github.com/diaspora/diaspora/pull/7342) * Fix regex for hashtags for some languages [#7350](https://github.com/diaspora/diaspora/pull/7350) ## Features * Add support for [Liberapay](https://liberapay.com) donations [#7290](https://github.com/diaspora/diaspora/pull/7290) Loading app/assets/javascripts/app/helpers/text_formatter.js +8 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,14 @@ var hashtagPlugin = window.markdownitHashtag; md.use(hashtagPlugin, { // compare tag_text_regexp in app/models/acts_as_taggable_on-tag.rb hashtagRegExp: "[" + PosixBracketExpressions.alnum + "_\\-]+|<3", hashtagRegExp: "[" + PosixBracketExpressions.word + "\\u055b" + // Armenian emphasis mark "\\u055c" + // Armenian exclamation mark "\\u055e" + // Armenian question mark "\\u058a" + // Armenian hyphen "_" + "\\-" + "]+|<3", // compare tag_strings in lib/diaspora/taggabe.rb preceding: "^|\\s" }); Loading app/models/acts_as_taggable_on-tag.rb +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ module ActsAsTaggableOn self.include_root_in_json = false def self.tag_text_regexp @@tag_text_regexp ||= "[[:alnum:]]_-" @tag_text_regexp ||= "[[:word:]]\u055b\u055c\u055e\u058a_-" end def self.autocomplete(name) Loading lib/assets/javascripts/posix-bracket-expressions.js +1360 −443 File changed.Preview size limit exceeded, changes collapsed. Show changes spec/javascripts/app/helpers/text_formatter_spec.js +31 −6 Original line number Diff line number Diff line Loading @@ -9,21 +9,46 @@ describe("app.helpers.textFormatter", function(){ // https://github.com/svbergerem/markdown-it-hashtag/tree/master/test context("hashtags", function() { beforeEach(function() { this.tags = [ this.goodTags = [ "tag", "diaspora", "PARTIES", "<3" "<3", "diaspora-dev", "diaspora_dev", // issue #5765 "മലയാണ്മ", // issue #5815 "ինչո՞ւ", "այո՜ո", "սեւ֊սպիտակ", "գժանո՛ց" ]; this.badTags = [ "tag.tag", "hash:tag", "hash*tag" ]; }); it("renders tags as links", function() { var formattedText = this.formatter('#'+this.tags.join(" #")); _.each(this.tags, function(tag) { var link ='<a href="/tags/'+tag.toLowerCase()+'" class="tag">#'+tag.replace("<","<")+'</a>'; it("renders good tags as links", function() { var self = this; this.goodTags.forEach(function(tag) { var formattedText = self.formatter("#newhashtag #" + tag + " test"); var link = "<a href=\"/tags/" + tag.toLowerCase() + "\" class=\"tag\">#" + tag.replace("<", "<") + "</a>"; expect(formattedText).toContain(link); }); }); it("doesn't render bad tags as links", function() { var self = this; this.badTags.forEach(function(tag) { var formattedText = self.formatter("#newhashtag #" + tag + " test"); var link = "<a href=\"/tags/" + tag.toLowerCase() + "\" class=\"tag\">#" + tag.replace("<", "<") + "</a>"; expect(formattedText).not.toContain(link); }); }); }); // Some basic specs. For more detailed specs see Loading Loading
Changelog.md +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ * Remove whitespace from author link [#7330](https://github.com/diaspora/diaspora/pull/7330) * Fix autosize in modals [#7339](https://github.com/diaspora/diaspora/pull/7339) * Only display invite link on contacts page if invitations are enabled [#7342](https://github.com/diaspora/diaspora/pull/7342) * Fix regex for hashtags for some languages [#7350](https://github.com/diaspora/diaspora/pull/7350) ## Features * Add support for [Liberapay](https://liberapay.com) donations [#7290](https://github.com/diaspora/diaspora/pull/7290) Loading
app/assets/javascripts/app/helpers/text_formatter.js +8 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,14 @@ var hashtagPlugin = window.markdownitHashtag; md.use(hashtagPlugin, { // compare tag_text_regexp in app/models/acts_as_taggable_on-tag.rb hashtagRegExp: "[" + PosixBracketExpressions.alnum + "_\\-]+|<3", hashtagRegExp: "[" + PosixBracketExpressions.word + "\\u055b" + // Armenian emphasis mark "\\u055c" + // Armenian exclamation mark "\\u055e" + // Armenian question mark "\\u058a" + // Armenian hyphen "_" + "\\-" + "]+|<3", // compare tag_strings in lib/diaspora/taggabe.rb preceding: "^|\\s" }); Loading
app/models/acts_as_taggable_on-tag.rb +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ module ActsAsTaggableOn self.include_root_in_json = false def self.tag_text_regexp @@tag_text_regexp ||= "[[:alnum:]]_-" @tag_text_regexp ||= "[[:word:]]\u055b\u055c\u055e\u058a_-" end def self.autocomplete(name) Loading
lib/assets/javascripts/posix-bracket-expressions.js +1360 −443 File changed.Preview size limit exceeded, changes collapsed. Show changes
spec/javascripts/app/helpers/text_formatter_spec.js +31 −6 Original line number Diff line number Diff line Loading @@ -9,21 +9,46 @@ describe("app.helpers.textFormatter", function(){ // https://github.com/svbergerem/markdown-it-hashtag/tree/master/test context("hashtags", function() { beforeEach(function() { this.tags = [ this.goodTags = [ "tag", "diaspora", "PARTIES", "<3" "<3", "diaspora-dev", "diaspora_dev", // issue #5765 "മലയാണ്മ", // issue #5815 "ինչո՞ւ", "այո՜ո", "սեւ֊սպիտակ", "գժանո՛ց" ]; this.badTags = [ "tag.tag", "hash:tag", "hash*tag" ]; }); it("renders tags as links", function() { var formattedText = this.formatter('#'+this.tags.join(" #")); _.each(this.tags, function(tag) { var link ='<a href="/tags/'+tag.toLowerCase()+'" class="tag">#'+tag.replace("<","<")+'</a>'; it("renders good tags as links", function() { var self = this; this.goodTags.forEach(function(tag) { var formattedText = self.formatter("#newhashtag #" + tag + " test"); var link = "<a href=\"/tags/" + tag.toLowerCase() + "\" class=\"tag\">#" + tag.replace("<", "<") + "</a>"; expect(formattedText).toContain(link); }); }); it("doesn't render bad tags as links", function() { var self = this; this.badTags.forEach(function(tag) { var formattedText = self.formatter("#newhashtag #" + tag + " test"); var link = "<a href=\"/tags/" + tag.toLowerCase() + "\" class=\"tag\">#" + tag.replace("<", "<") + "</a>"; expect(formattedText).not.toContain(link); }); }); }); // Some basic specs. For more detailed specs see Loading