Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jQuery .text() #30506

Merged
merged 23 commits into from
Jun 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor quote reply
silverwind committed Jun 6, 2024
commit 068b2751c6b50f31aa6bd2f9e26f431d04c9e736
7 changes: 4 additions & 3 deletions web_src/js/features/repo-issue-edit.js
Original file line number Diff line number Diff line change
@@ -189,11 +189,12 @@ export function initRepoIssueCommentEdit() {
// Quote reply
$(document).on('click', '.quote-reply', async function (event) {
event.preventDefault();
const target = $(this).data('target');
const quote = $(`#${target}`)[0].textContent.replace(/\n/g, '\n> ');
const target = this.getAttribute('data-target');
const quote = document.querySelector(`#${target}`).textContent.replace(/\n/g, '\n> ');
const content = `> ${quote}\n\n`;

let editor;
if ($(this).hasClass('quote-reply-diff')) {
if (this.classList.contains('quote-reply-diff')) {
const $replyBtn = $(this).closest('.comment-code-cloud').find('button.comment-form-reply');
editor = await handleReply($replyBtn);
} else {