From b3bbf53e9bd0d3eb4b947f0e1f01887120e7a2fb Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 5 Sep 2012 16:14:54 -0400 Subject: [PATCH] Set the size of emoji to be 20x20 Forgot they were so big! --- lib/gitlab/markdown.rb | 2 +- spec/helpers/gitlab_markdown_helper_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index f000ffb4e24..5fa921239ad 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -95,7 +95,7 @@ module Gitlab text = text.gsub(EMOJI_PATTERN) do |match| if valid_emoji?($2) - helper.image_tag("#{$2}.png", class: 'emoji', title: $1, alt: $1) + helper.image_tag("#{$2}.png", size: "20x20", class: 'emoji', title: $1, alt: $1) else match end diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index e2b38f0a715..3e7a02c6e35 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -234,6 +234,12 @@ describe GitlabMarkdownHelper do gfm(":+1:").should match('class="emoji"') end + it "sets height and width" do + actual = gfm(":+1:") + actual.should match(/width="20"/) + actual.should match(/height="20"/) + end + it "keeps whitespace intact" do gfm("This deserves a :+1: big time.").should match(/deserves a big time/) end