From 8c3c3d8d5183f792b4b50fefea0356f48a453d22 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Thu, 19 Oct 2023 17:48:16 +0200 Subject: [PATCH] #1171: Render markdown with diffMK for details popup * Sanitized markdown raises a warning: ``` marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options marked.min.js:6:44783 ``` --- www/calendar/inner.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/www/calendar/inner.js b/www/calendar/inner.js index d37554155..0c8cff264 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -24,6 +24,8 @@ define([ '/common/inner/access.js', '/common/inner/properties.js', + '/common/diffMarked.js', + '/common/jscolor.js', '/components/file-saver/FileSaver.min.js', 'css!/lib/calendar/tui-calendar.min.css', @@ -51,7 +53,8 @@ define([ Export, Rec, Flatpickr, - Share, Access, Properties + Share, Access, Properties, + diffMk, ) { Messages.calendar_rec_change_first = "You moved the first repeating event to different calendar. You can only apply this change to all repeated events."; // XXX New translation key @@ -392,11 +395,9 @@ define([ return Messages._getKey('calendar_location', [str]); }, popupDetailBody: function(schedule) { - var d = schedule.body; - var str = Util.fixHTML(d); - str = str.replace(/(?:\r\n|\r|\n)/g, '
'); + var str = schedule.body; delete APP.body; - return 'Description:
' + str; + return 'Description:
' + diffMk.render(str,true); }, popupIsAllDay: function() { return Messages.calendar_allDay; }, titlePlaceholder: function() { return Messages.calendar_title; },