Skip to content

Commit dcfa42d

Browse files
authored
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
1 parent f1cd90d commit dcfa42d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/features/repo-issue-edit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ async function tryOnQuoteReply(e: Event) {
132132
const targetMarkupToQuote = targetRawToQuote.parentElement.querySelector<HTMLElement>('.render-content.markup');
133133
let contentToQuote = extractSelectedMarkdown(targetMarkupToQuote);
134134
if (!contentToQuote) contentToQuote = targetRawToQuote.textContent;
135-
const quotedContent = `${contentToQuote.replace(/^/mg, '> ')}\n`;
135+
const quotedContent = `${contentToQuote.replace(/^/mg, '> ')}\n\n`;
136136

137137
let editor;
138138
if (clickTarget.classList.contains('quote-reply-diff')) {

0 commit comments

Comments
 (0)