Created
May 17, 2012 07:32
-
-
Save kaznum/2717199 to your computer and use it in GitHub Desktop.
Emolett変換
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
module EmolettHelper | |
def emolettise(str) | |
str.gsub(/(\(|()(笑|爆|嬉|喜|楽|驚|泣|涙|悲|怒|厳|辛|苦|閃|汗|忙|急|輝)(\)|))/) { |s| | |
"<span class='emo'>#{s}</span>" | |
}.html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment