Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 18:07:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 18:07:25 +0300
commit5e97da08cba997aefba6f6d13850f95536a80477 (patch)
treebd6d968e0f5054913d3f1463843ebd811fbfb32c /app/assets/javascripts/deprecated_notes.js
parent09b4875c004d2db76b15cb0b32e7a7e623bbfa6f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/deprecated_notes.js')
-rw-r--r--app/assets/javascripts/deprecated_notes.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/deprecated_notes.js b/app/assets/javascripts/deprecated_notes.js
index c090a66a69d..5c6874593a4 100644
--- a/app/assets/javascripts/deprecated_notes.js
+++ b/app/assets/javascripts/deprecated_notes.js
@@ -15,6 +15,7 @@ import Autosize from 'autosize';
import $ from 'jquery';
import { escape, uniqueId } from 'lodash';
import Vue from 'vue';
+import { renderGFM } from '~/behaviors/markdown/render_gfm';
import { createAlert, VARIANT_INFO } from '~/flash';
import '~/lib/utils/jquery_at_who';
import AjaxCache from '~/lib/utils/ajax_cache';
@@ -40,7 +41,6 @@ import { localTimeAgo } from './lib/utils/datetime_utility';
import { getLocationHash } from './lib/utils/url_utility';
import { sprintf, s__, __ } from './locale';
import TaskList from './task_list';
-import '~/behaviors/markdown/init_gfm';
window.autosize = Autosize;
@@ -516,7 +516,11 @@ export default class Notes {
}
if (discussionContainer.length === 0) {
if (noteEntity.diff_discussion_html) {
- const $discussion = $(noteEntity.diff_discussion_html).renderGFM();
+ const discussionElement = document.createElement('table');
+ // eslint-disable-next-line no-unsanitized/method
+ discussionElement.insertAdjacentHTML('afterbegin', noteEntity.diff_discussion_html);
+ renderGFM(discussionElement);
+ const $discussion = $(discussionElement).unwrap();
if (!this.isParallelView() || row.hasClass('js-temp-notes-holder') || noteEntity.on_image) {
// insert the note and the reply button after the temp row
@@ -708,7 +712,7 @@ export default class Notes {
$noteAvatar.append($targetNoteBadge);
this.revertNoteEditForm($targetNote);
- $noteEntityEl.renderGFM();
+ renderGFM($noteEntityEl.get(0));
// Find the note's `li` element by ID and replace it with the updated HTML
const $note_li = $(`.note-row-${noteEntity.id}`);
@@ -1382,7 +1386,8 @@ export default class Notes {
static animateAppendNote(noteHtml, $notesList) {
const $note = $(noteHtml);
- $note.addClass('fade-in-full').renderGFM();
+ $note.addClass('fade-in-full');
+ renderGFM($note.get(0));
$notesList.append($note);
return $note;
}
@@ -1390,7 +1395,8 @@ export default class Notes {
static animateUpdateNote(noteHtml, $note) {
const $updatedNote = $(noteHtml);
- $updatedNote.addClass('fade-in').renderGFM();
+ $updatedNote.addClass('fade-in');
+ renderGFM($updatedNote.get(0));
$note.replaceWith($updatedNote);
return $updatedNote;
}