Fix image not appearing due to url

Images will now appear in news feed - is most likely a single issue fix, will update code if problem persists.
This commit is contained in:
Thomas Apter 2021-07-14 22:29:40 +01:00
parent 88d66b9653
commit 93db220bcc

View File

@ -1262,7 +1262,8 @@ function loadNews(){
let regex = /src="(?!http:\/\/|https:\/\/)(.+?)"/g
let matches
while((matches = regex.exec(content))){
content = content.replace(`"${matches[1]}"`, `"${newsHost + matches[1]}"`)
// Fix //news issue - Probably only fixes this situation, if problem persists will make more robust.
content = content.replace(`"${matches[1]}"`, `"https:${matches[1]}"`)
}
let link = el.find('link').text()