fix: improve accessibility and remove unnecessary attributes

Enhanced accessibility by wrapping time display in a semantic `<time>` element, ensuring better screen reader support. Removed inline styles and onclick attributes from elements, simplifying the code and improving performance.
This commit is contained in:
ccbikai
2024-09-21 16:39:57 +08:00
parent dac74bc9d8
commit ff418d81a8
2 changed files with 5 additions and 3 deletions

View File

@@ -100,9 +100,9 @@ function getReply($, item, { channel }) {
}
function modifyHTMLContent($, content, { index } = {}) {
$(content).find('.emoji')?.attr('style', '')
$(content).find('.emoji')?.removeAttr('style')
$(content).find('a')?.each((_index, a) => {
$(a)?.attr('title', $(a)?.text())?.attr('onclick', '')
$(a)?.attr('title', $(a)?.text())?.removeAttr('onclick')
})
$(content).find('tg-spoiler')?.each((_index, spoiler) => {
const id = `spoiler-${index}-${_index}`