Add wrapper to do markup_format later on

This commit is contained in:
Alexander Meindl
2018-01-28 12:29:31 +01:00
parent 585d49bdec
commit 25744d4337
3 changed files with 8 additions and 3 deletions

View File

@@ -3,6 +3,11 @@ require 'net/http'
class Messenger
include Redmine::I18n
def self.markup_format(text)
# Redmine::WikiFormatting.html_parser.to_text(text)
ERB::Util.html_escape(text)
end
def self.default_url_options
{ only_path: true, script_name: Redmine::Utils.relative_url_root }
end

View File

@@ -21,7 +21,7 @@ module RedmineMessenger
attachment = {}
if description.present? && Messenger.setting_for_project(project, :new_include_description)
attachment[:text] = ERB::Util.html_escape(description)
attachment[:text] = Messenger.markup_format(description)
end
attachment[:fields] = [{ title: I18n.t(:field_status),
value: ERB::Util.html_escape(status.to_s),
@@ -64,7 +64,7 @@ module RedmineMessenger
attachment = {}
if current_journal.notes.present? && Messenger.setting_for_project(project, :updated_include_description)
attachment[:text] = ERB::Util.html_escape(current_journal.notes)
attachment[:text] = Messenger.markup_format(current_journal.notes)
end
fields = current_journal.details.map { |d| Messenger.detail_to_field d }

View File

@@ -37,7 +37,7 @@ module RedmineMessenger
attachment = nil
unless content.comments.empty?
attachment = {}
attachment[:text] = ERB::Util.html_escape(content.comments.to_s)
attachment[:text] = Messenger.markup_format(content.comments.to_s)
end
Messenger.speak(l(:label_messenger_wiki_updated,