Module: Jekyll::SmileyFilter

Defined in:
lib/jekyll-smiley.rb

Instance Method Summary collapse

Instance Method Details

#smiley(message) ⇒ Object


32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/jekyll-smiley.rb', line 32

def smiley(message)
  site = @context.registers[:site].config

  smileys = site["smileys"]
  message.gsub!(/:([a-z]+):/) do |match|
    smiley = smileys[$1]
    if smiley
      "![#{$1}](#{smiley["img"]})"
    end
  end
  message
end