Fix documentation for reddit support and better regexp integration

This commit is contained in:
Alexander Meindl 2017-06-05 10:07:44 +02:00
parent 018056adbd
commit 790a5ac489
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ If a parameter is in brackets, this parameter is optional.
.. include:: macros/members.rst
.. include:: macros/projects.rst
.. include:: macros/recently_updated.rst
.. include:: macros/reddit.rst
.. include:: macros/slideshare.rst
.. include:: macros/twitter.rst
.. include:: macros/user.rst

View File

@ -49,11 +49,12 @@ module RedmineTweaks
def inline_emojify(text)
text.gsub!(/:([\w+-]+):/) do |match|
emoji = Emoji.find_by_alias(Regexp.last_match(1))
emoji_code = Regexp.last_match(1)
emoji = Emoji.find_by_alias(emoji_code)
if emoji.present?
tag(:img,
src: inline_emojify_image_path(emoji.image_filename),
title: ":#{Regexp.last_match(1)}:",
title: ":#{emoji_code}:",
style: 'vertical-align: middle',
width: '20',
height: '20')