Skip to content

Commit

Permalink
add data-proofer-ignore to output
Browse files Browse the repository at this point in the history
  • Loading branch information
benbalter committed Feb 19, 2016
1 parent 0c8f738 commit 45bab4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 7 additions & 6 deletions lib/jekyll-avatar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ def render(context)

def attributes
{
class: classes,
src: url,
alt: username,
srcset: srcset,
width: size,
height: size
:class => classes,
:src => url,
:alt => username,
:srcset => srcset,
:width => size,
:height => size,
:'data-proofer-ignore' => true
}
end

Expand Down
10 changes: 7 additions & 3 deletions spec/jekyll/avatar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
expected << 'https://avatars3.githubusercontent.com/hubot?v=3&amp;s=80 2x, '
expected << 'https://avatars3.githubusercontent.com/hubot?v=3&amp;s=120 3x, '
expected << 'https://avatars3.githubusercontent.com/hubot?v=3&amp;s=160 4x" '
expected << 'width="40" height="40" />'
expected << 'width="40" height="40" data-proofer-ignore="true" />'
expect(rendered)
expect(output).to eql("<p>#{expected}</p>\n")
end
Expand Down Expand Up @@ -64,6 +64,10 @@
expect(attrs[:height]).to eql(40)
end

it 'includes data-proofer-ignore' do
expect(output).to match(/data-proofer-ignore=\"true\"/)
end

context 'retina' do
it 'builds the path with a scale' do
expect(subject.send(:path, 2)).to eql('hubot?v=3&s=80')
Expand Down Expand Up @@ -133,7 +137,7 @@
expected << 'https://avatars0.githubusercontent.com/hubot2?v=3&amp;s=80 2x, '
expected << 'https://avatars0.githubusercontent.com/hubot2?v=3&amp;s=120 3x, '
expected << 'https://avatars0.githubusercontent.com/hubot2?v=3&amp;s=160 4x" '
expected << 'width="40" height="40" />'
expected << 'width="40" height="40" data-proofer-ignore="true" />'
expect(output).to eql("<p>#{expected}</p>\n")
end
end
Expand All @@ -149,7 +153,7 @@
expected << 'https://avatars0.githubusercontent.com/hubot2?v=3&amp;s=80 2x, '
expected << 'https://avatars0.githubusercontent.com/hubot2?v=3&amp;s=120 3x, '
expected << 'https://avatars0.githubusercontent.com/hubot2?v=3&amp;s=160 4x" '
expected << 'width="40" height="40" />'
expected << 'width="40" height="40" data-proofer-ignore="true" />'
expect(output).to eql("<p>#{expected}</p>\n")
end
end
Expand Down

1 comment on commit 45bab4f

@XhmikosR
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I don't think this makes sense for the general public.

You could add a new option to pass an attribute or something, instead.

Please sign in to comment.