mirror of
https://github.com/go-gitea/gitea.git
synced 2025-05-03 06:01:36 +00:00
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
This commit is contained in:
parent
f1cd90d3bd
commit
dcfa42dd8f
@ -132,7 +132,7 @@ async function tryOnQuoteReply(e: Event) {
|
|||||||
const targetMarkupToQuote = targetRawToQuote.parentElement.querySelector<HTMLElement>('.render-content.markup');
|
const targetMarkupToQuote = targetRawToQuote.parentElement.querySelector<HTMLElement>('.render-content.markup');
|
||||||
let contentToQuote = extractSelectedMarkdown(targetMarkupToQuote);
|
let contentToQuote = extractSelectedMarkdown(targetMarkupToQuote);
|
||||||
if (!contentToQuote) contentToQuote = targetRawToQuote.textContent;
|
if (!contentToQuote) contentToQuote = targetRawToQuote.textContent;
|
||||||
const quotedContent = `${contentToQuote.replace(/^/mg, '> ')}\n`;
|
const quotedContent = `${contentToQuote.replace(/^/mg, '> ')}\n\n`;
|
||||||
|
|
||||||
let editor;
|
let editor;
|
||||||
if (clickTarget.classList.contains('quote-reply-diff')) {
|
if (clickTarget.classList.contains('quote-reply-diff')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user