diff --git a/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js b/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js index 67c1dfc7b9..9d5a8cd7bc 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/emoji-test.js @@ -13,7 +13,7 @@ acceptance("Emoji", function (needs) { await fillIn(".d-editor-input", "this is an emoji :blonde_woman:"); assert.equal( queryAll(".d-editor-preview:visible").html().trim(), - `
this is an emoji 
this is an emoji 
this is an emoji 
this is an emoji 
`,
+ `emojis title
`,
"it displays the new title with emojis"
);
});
@@ -196,7 +196,7 @@ acceptance("Topic", function (needs) {
assert.equal(
queryAll(".fancy-title").html().trim(),
- `emojis title 
`,
+ `emojis title 
`,
"it displays the new title with escaped unicode emojis"
);
});
@@ -212,7 +212,7 @@ acceptance("Topic", function (needs) {
assert.equal(
queryAll(".fancy-title").html().trim(),
- `Test
Title`,
+ `Test
Title`,
"it displays the new title with escaped unicode emojis"
);
});
diff --git a/app/assets/javascripts/discourse/tests/helpers/site-settings.js b/app/assets/javascripts/discourse/tests/helpers/site-settings.js
index 43e60820dd..74de61bff1 100644
--- a/app/assets/javascripts/discourse/tests/helpers/site-settings.js
+++ b/app/assets/javascripts/discourse/tests/helpers/site-settings.js
@@ -89,7 +89,7 @@ const ORIGINAL_SETTINGS = {
"apache|bash|cs|cpp|css|coffeescript|diff|xml|http|ini|json|java|javascript|makefile|markdown|nginx|objectivec|ruby|perl|php|python|sql|handlebars",
enable_emoji: true,
enable_emoji_shortcuts: true,
- emoji_set: "emoji_one",
+ emoji_set: "google_classic",
enable_emoji_shortcuts: true,
enable_inline_emoji_translation: false,
desktop_category_page_style: "categories_and_latest_topics",
diff --git a/app/assets/javascripts/discourse/tests/unit/lib/emoji-test.js b/app/assets/javascripts/discourse/tests/unit/lib/emoji-test.js
index 22d24503b8..8c75f8efb8 100644
--- a/app/assets/javascripts/discourse/tests/unit/lib/emoji-test.js
+++ b/app/assets/javascripts/discourse/tests/unit/lib/emoji-test.js
@@ -32,12 +32,12 @@ discourseModule("Unit | Utility | emoji", function () {
);
testUnescape(
"emoticons :)",
- `emoticons
`,
+ `emoticons
`,
"emoticons are still supported"
);
testUnescape(
"With emoji :O: :frog: :smile:",
- `With emoji
`,
+ `With emoji
`,
"title with emoji"
);
testUnescape(
@@ -47,27 +47,27 @@ discourseModule("Unit | Utility | emoji", function () {
);
testUnescape(
"(:frog:) :)",
- `(
)
`,
+ `(
)
`,
"non-word characters allowed next to emoji"
);
testUnescape(
":smile: hi",
- `
hi`,
+ `
hi`,
"start of line"
);
testUnescape(
"hi :smile:",
- `hi
`,
+ `hi
`,
"end of line"
);
testUnescape(
"hi :blonde_woman:t4:",
- `hi
`,
+ `hi
`,
"support for skin tones"
);
testUnescape(
"hi :blonde_woman:t4: :blonde_man:t6:",
- `hi
`,
+ `hi
`,
"support for multiple skin tones"
);
testUnescape(
@@ -95,7 +95,7 @@ discourseModule("Unit | Utility | emoji", function () {
);
testUnescape(
"Hello 😊 World",
- `Hello
World`,
+ `Hello
World`,
"emoji from Unicode emoji"
);
testUnescape(
@@ -108,7 +108,7 @@ discourseModule("Unit | Utility | emoji", function () {
);
testUnescape(
"Hello😊World",
- `Hello
World`,
+ `Hello
World`,
"emoji from Unicode emoji when inline translation enabled",
{
enable_inline_emoji_translation: true,
@@ -124,7 +124,7 @@ discourseModule("Unit | Utility | emoji", function () {
);
testUnescape(
"hi:smile:",
- `hi
`,
+ `hi
`,
"emoji when inline translation enabled",
{ enable_inline_emoji_translation: true }
);
diff --git a/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js b/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js
index c584911dce..a00ad68b54 100644
--- a/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js
+++ b/app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js
@@ -16,7 +16,7 @@ const rawOpts = {
enable_emoji: true,
enable_emoji_shortcuts: true,
enable_mentions: true,
- emoji_set: "emoji_one",
+ emoji_set: "google_classic",
highlighted_languages: "json|ruby|javascript",
default_code_lang: "auto",
enable_markdown_linkify: true,
@@ -1485,15 +1485,15 @@ var bar = 'bar';
test("emoji", function (assert) {
assert.cooked(
":smile:",
- `





test
test
test
test
with all
the emojis 
`,
+ `
with all
the emojis 
`,
"supports emojis"
);
});
@@ -159,7 +159,7 @@ discourseModule("Unit | Model | topic", function () {
assert.equal(
topic.get("escapedExcerpt"),
- `This is a test topic
`,
+ `This is a test topic
`,
"supports emojis"
);
});
diff --git a/app/models/emoji_set_site_setting.rb b/app/models/emoji_set_site_setting.rb
index 8437e0a307..0fe4772390 100644
--- a/app/models/emoji_set_site_setting.rb
+++ b/app/models/emoji_set_site_setting.rb
@@ -13,7 +13,6 @@ class EmojiSetSiteSetting < EnumSiteSetting
{ name: 'emoji_set.apple_international', value: 'apple' },
{ name: 'emoji_set.google', value: 'google' },
{ name: 'emoji_set.twitter', value: 'twitter' },
- { name: 'emoji_set.emoji_one', value: 'emoji_one' },
{ name: 'emoji_set.win10', value: 'win10' },
{ name: 'emoji_set.google_classic', value: 'google_classic' },
{ name: 'emoji_set.facebook_messenger', value: 'facebook_messenger' },
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 8512284510..5838a60fa0 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1819,7 +1819,6 @@ en:
apple_international: "Apple/International"
google: "Google"
twitter: "Twitter"
- emoji_one: "JoyPixels (formerly EmojiOne)"
win10: "Win10"
google_classic: "Google Classic"
facebook_messenger: "Facebook Messenger"
diff --git a/db/migrate/20210224162050_remove_emoji_one_from_emoji_set_site_setting.rb b/db/migrate/20210224162050_remove_emoji_one_from_emoji_set_site_setting.rb
new file mode 100644
index 0000000000..1ffbaac72d
--- /dev/null
+++ b/db/migrate/20210224162050_remove_emoji_one_from_emoji_set_site_setting.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveEmojiOneFromEmojiSetSiteSetting < ActiveRecord::Migration[6.0]
+ def up
+ result = execute("SELECT value FROM site_settings WHERE name='emoji_set' and value='emoji_one'")
+ return unless result.count > 0
+
+ execute "DELETE FROM site_settings where name='emoji_set' and value='emoji_one'"
+ execute "UPDATE posts SET baked_version = 0 WHERE cooked LIKE '%/images/emoji/emoji_one%'"
+ end
+
+ def down
+ # Cannot undo
+ end
+end
diff --git a/lib/tasks/emoji.rake b/lib/tasks/emoji.rake
index ace173d55c..4cf1372256 100644
--- a/lib/tasks/emoji.rake
+++ b/lib/tasks/emoji.rake
@@ -262,7 +262,6 @@ DEFAULT_SET ||= "twitter"
# Replace the platform by another when downloading the image (accepts names or categories)
EMOJI_IMAGES_PATCH ||= {
"apple" => { "snowboarder" => "twitter" },
- "emoji_one" => { "country-flag" => "twitter" },
"windows" => { "country-flag" => "twitter" }
}
@@ -272,7 +271,6 @@ EMOJI_SETS ||= {
"google_blob" => "google_classic",
"facebook" => "facebook_messenger",
"twitter" => "twitter",
- "emoji_one" => "emoji_one",
"windows" => "win10",
}
@@ -537,7 +535,7 @@ class TestEmojiUpdate < MiniTest::Test
assert_equal File.size(original_image), File.size(alias_image)
original_image = image_path("twitter", "macau")
- alias_image = image_path("emoji_one", "macau")
+ alias_image = image_path("win10", "macau")
assert_equal File.size(original_image), File.size(alias_image)
end
end
diff --git a/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6 b/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6
index b9587612cf..1962054ab9 100644
--- a/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6
+++ b/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6
@@ -5,7 +5,7 @@ module("lib:details-cooked-test");
const defaultOpts = buildOptions({
siteSettings: {
enable_emoji: true,
- emoji_set: "emoji_one",
+ emoji_set: "google_classic",
highlighted_languages: "json|ruby|javascript",
default_code_lang: "auto",
},
diff --git a/spec/components/email/styles_spec.rb b/spec/components/email/styles_spec.rb
index 4c1db48904..1520662dc5 100644
--- a/spec/components/email/styles_spec.rb
+++ b/spec/components/email/styles_spec.rb
@@ -159,14 +159,14 @@ describe Email::Styles do
context "strip_avatars_and_emojis" do
it "works for lonesome emoji with no title" do
- emoji = "
"
+ emoji = "
"
style = Email::Styles.new(emoji)
style.strip_avatars_and_emojis
expect(style.to_html).to match_html(emoji)
end
it "works for lonesome emoji with title" do
- emoji = "
"
+ emoji = "
"
style = Email::Styles.new(emoji)
style.strip_avatars_and_emojis
expect(style.to_html).to match_html("cry_cry")