From 46cbba04fc619c0e04212fd2342a9d8bab25fed4 Mon Sep 17 00:00:00 2001 From: fsologureng Date: Fri, 9 Dec 2022 00:53:14 -0300 Subject: [PATCH] Change ID pattern of raw content container for issues and comments to avoid internal ID collisions. Fixes #21965. --- templates/repo/diff/comments.tmpl | 2 +- templates/repo/issue/view_content.tmpl | 2 +- templates/repo/issue/view_content/comments.tmpl | 6 +++--- templates/repo/issue/view_content/context_menu.tmpl | 4 ++-- web_src/js/features/repo-issue.js | 2 +- web_src/js/features/repo-legacy.js | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 647c662d51ce6..8fc51e62f25ba 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -54,7 +54,7 @@ {{$.root.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{$reactions := .Reactions.GroupByType}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 0cb74e8182904..9c5f9a4779498 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -77,7 +77,7 @@ {{.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Issue.Content}}
+
{{.Issue.Content}}
{{if .Issue.Attachments}} {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments "Content" .Issue.RenderedContent}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index e9b7172d1b324..d013c7b761ba2 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -77,7 +77,7 @@ {{$.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{if .Attachments}} {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}} @@ -449,7 +449,7 @@ {{$.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{if .Attachments}} {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}} @@ -576,7 +576,7 @@ {{$.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{$reactions := .Reactions.GroupByType}} diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index 45dd08bf61035..7459623a54d9e 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -11,9 +11,9 @@ {{$referenceUrl = Printf "%s/files#%s" .ctx.Issue.HTMLURL .item.HashTag}} {{end}}
{{.ctx.locale.Tr "repo.issues.context.copy_link"}}
-
{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}
+
{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}
{{if not .ctx.UnitIssuesGlobalDisabled}} -
{{.ctx.locale.Tr "repo.issues.context.reference_issue"}}
+
{{.ctx.locale.Tr "repo.issues.context.reference_issue"}}
{{end}} {{if or .ctx.Permission.IsAdmin .IsCommentPoster .ctx.HasIssuesOrPullsWritePermission}}
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 54cdeb383b8f9..ca5d69c5a6d7a 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -553,7 +553,7 @@ export function initRepoIssueReferenceIssue() { const $this = $(this); $this.closest('.dropdown').find('.menu').toggle('visible'); - const content = $(`#comment-${$this.data('target')}`).text(); + const content = $(`#${$this.data('target')}`).text(); const poster = $this.data('poster-username'); const reference = $this.data('reference'); const $modal = $($this.data('modal')); diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index d438186c5f5ae..910d4bb56c8db 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -566,7 +566,7 @@ function initRepoIssueCommentEdit() { $(document).on('click', '.quote-reply', function (event) { $(this).closest('.dropdown').find('.menu').toggle('visible'); const target = $(this).data('target'); - const quote = $(`#comment-${target}`).text().replace(/\n/g, '\n> '); + const quote = $(`#${target}`).text().replace(/\n/g, '\n> '); const content = `> ${quote}\n\n`; let easyMDE; if ($(this).hasClass('quote-reply-diff')) {