This commit is contained in:
SBD
2023-11-28 16:20:01 +03:00
parent 3cf374c755
commit e8a0227e77

View File

@@ -76,14 +76,16 @@ function replaceHrefOnOnclick () {
elements.forEach(function (){
let cur_el = elements[i]
if (cur_el.attributes.hasOwnProperty("href")){
cur_el.setAttribute("onclick",`renderContent(this)`)
let str = cur_el.outerHTML
let str_f_replace = cur_el.href
str_f_replace = str_f_replace.replace(`${window.location.origin}`,'')
str_f_replace = `href="${str_f_replace}"`
str = str.replace(str_f_replace,'')
str = str.replace('"target="_blank""','')
cur_el.outerHTML = str
cur_el.setAttribute("onclick",`renderContent(this)`)
}
i++
})