From dcfa42dd8f4f8d5b924bac3b372bad4466c52fa0 Mon Sep 17 00:00:00 2001 From: "Hyungsub (Danny) Kim" Date: Wed, 16 Apr 2025 15:32:58 +0900 Subject: [PATCH] Fix: quoted replies incorrectly render user input as part of the quote (#34216) Updated the quote insertion logic so that it adds one more line break (`\n`) work like Github. This way, the cursor lands on a new line and the user's reply is no longer interpreted as part of the quote. Fixes #34177 --- web_src/js/features/repo-issue-edit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/repo-issue-edit.ts b/web_src/js/features/repo-issue-edit.ts index b3de91c3bd..e89e5a787a 100644 --- a/web_src/js/features/repo-issue-edit.ts +++ b/web_src/js/features/repo-issue-edit.ts @@ -132,7 +132,7 @@ async function tryOnQuoteReply(e: Event) { const targetMarkupToQuote = targetRawToQuote.parentElement.querySelector('.render-content.markup'); let contentToQuote = extractSelectedMarkdown(targetMarkupToQuote); if (!contentToQuote) contentToQuote = targetRawToQuote.textContent; - const quotedContent = `${contentToQuote.replace(/^/mg, '> ')}\n`; + const quotedContent = `${contentToQuote.replace(/^/mg, '> ')}\n\n`; let editor; if (clickTarget.classList.contains('quote-reply-diff')) {