Fix documentation for reddit support and better regexp integration
This commit is contained in:
parent
018056adbd
commit
790a5ac489
@ -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
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user