2021-06-29 09:02:57 +00:00
|
|
|
module MessageFormatHelper
|
|
|
|
include RegexHelper
|
2021-12-09 06:20:28 +00:00
|
|
|
|
2021-06-29 09:02:57 +00:00
|
|
|
def transform_user_mention_content(message_content)
|
|
|
|
message_content.gsub(MENTION_REGEX, '\1')
|
|
|
|
end
|
2021-12-09 06:20:28 +00:00
|
|
|
|
|
|
|
def render_message_content(message_content)
|
|
|
|
# rubocop:disable Rails/OutputSafety
|
|
|
|
CommonMarker.render_html(message_content).html_safe
|
|
|
|
# rubocop:enable Rails/OutputSafety
|
|
|
|
end
|
2021-06-29 09:02:57 +00:00
|
|
|
end
|