Remove jQuery .text() (#30506)

Remove and forbid [.text()](https://api.jquery.com/text/). Tested some,
but not all functionality, but I think these are pretty safe
replacements.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind 2024-06-10 12:12:31 +02:00 committed by GitHub
parent 4f7d6feab7
commit a2304cb163
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 161 additions and 169 deletions

View file

@ -272,9 +272,9 @@ export function initRepoCommentForm() {
}
$list.find('.selected').html(`
<a class="item muted sidebar-item-link" href=${$(this).data('href')}>
<a class="item muted sidebar-item-link" href=${htmlEscape(this.getAttribute('href'))}>
${icon}
${htmlEscape($(this).text())}
${htmlEscape(this.textContent)}
</a>
`);