Commit 7bfa0f85 authored by Jonne Haß's avatar Jonne Haß

Merge branch 'stable' into develop

parents 7b7700b3 6c71d9f2
......@@ -87,6 +87,7 @@ Ruby 2.0 is no longer officially supported.
* Fix the logo in emails [#6013](https://github.com/diaspora/diaspora/pull/6013)
* Disable autocorrect for username on mobile sign in [#6028](https://github.com/diaspora/diaspora/pull/6028)
* Fix broken default avatars in the database [#6014](https://github.com/diaspora/diaspora/pull/6014)
* Only strip text direction codepoints around hashtags [#6067](https://github.com/diaspora/diaspora/issues/6067)
## Features
* Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843)
......
......@@ -16,7 +16,7 @@ module Diaspora
end
def normalize message
message.delete("\u202a-\u202e\u200b-\u200f")
message.gsub(/[\u202a\u202b]#[\u200e\u200f\u202d\u202e](\S+)\u202c/u, "#\\1")
end
end
......
require 'spec_helper'
describe Diaspora::MessageRenderer do
def message text, opts={}
MESSAGE_NORMALIZTIONS = {
"\u202a#\u200eUSA\u202c" => "#USA",
"ള്‍" => "ള്‍"
}
def message(text, opts={})
Diaspora::MessageRenderer.new(text, opts)
end
......@@ -122,10 +127,10 @@ describe Diaspora::MessageRenderer do
).to include 'href="http://joindiaspora.com/"'
end
it 'normalizes' do
expect(
message("\u202a#\u200eUSA\u202c").markdownified
).to eq %(<p><a class="tag" href="/tags/USA">#USA</a></p>\n)
it "normalizes" do
MESSAGE_NORMALIZTIONS.each do |input, output|
expect(message(input).plain_text_for_json).to eq output
end
end
context 'when formatting status messages' do
......@@ -218,10 +223,10 @@ describe Diaspora::MessageRenderer do
end
describe "#plain_text_for_json" do
it 'normalizes' do
expect(
message("\u202a#\u200eUSA\u202c").plain_text_for_json
).to eq '#USA'
it "normalizes" do
MESSAGE_NORMALIZTIONS.each do |input, output|
expect(message(input).plain_text_for_json).to eq output
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment