Added feature to open links in new tab
This commit is contained in:
parent
e68489717a
commit
fba92592aa
@ -1803,7 +1803,7 @@
|
|||||||
if (contentArea.textContent.trim() === '') {
|
if (contentArea.textContent.trim() === '') {
|
||||||
contentCard.querySelector('.submit-entry').classList.add('hide-completely')
|
contentCard.querySelector('.submit-entry').classList.add('hide-completely')
|
||||||
} else {
|
} else {
|
||||||
const cleanHTML = DOMPurify.sanitize(contentArea.innerHTML.split('\n').map(v => v.trim()).filter(v => v).join('\n'), { FORBID_ATTR: ['style'] })
|
const cleanHTML = DOMPurify.sanitize(contentArea.innerHTML.split('\n').map(v => v.trim()).filter(v => v).join('\n'), { FORBID_ATTR: ['style'], ADD_ATTR: ['target'] })
|
||||||
const hash = Crypto.SHA256(cleanHTML)
|
const hash = Crypto.SHA256(cleanHTML)
|
||||||
let previousHash
|
let previousHash
|
||||||
if (!isUniqueEntry) {
|
if (!isUniqueEntry) {
|
||||||
@ -1836,7 +1836,7 @@
|
|||||||
contentArea.firstChild.remove()
|
contentArea.firstChild.remove()
|
||||||
contentArea.prepend(p)
|
contentArea.prepend(p)
|
||||||
}
|
}
|
||||||
const cleanHTML = DOMPurify.sanitize(contentArea.innerHTML.split('\n').map(v => v.trim()).filter(v => v).join('\n'), { FORBID_ATTR: ['style'] })
|
const cleanHTML = DOMPurify.sanitize(contentArea.innerHTML.split('\n').map(v => v.trim()).filter(v => v).join('\n'), { FORBID_ATTR: ['style'], ADD_ATTR: ['target'] })
|
||||||
const hash = Crypto.SHA256(cleanHTML)
|
const hash = Crypto.SHA256(cleanHTML)
|
||||||
let previousVersion, previousHash
|
let previousVersion, previousHash
|
||||||
if (!isUniqueEntry) {
|
if (!isUniqueEntry) {
|
||||||
@ -1994,7 +1994,7 @@
|
|||||||
selectedContent.delete(contentID)
|
selectedContent.delete(contentID)
|
||||||
} else {
|
} else {
|
||||||
const sectionID = contentCard.closest('.article-section').dataset.sectionId
|
const sectionID = contentCard.closest('.article-section').dataset.sectionId
|
||||||
const content = DOMPurify.sanitize(contentCard.querySelector('.content__area').innerHTML.split('\n').map(v => v.trim()).filter(v => v).join('\n'), { FORBID_ATTR: ['style'] })
|
const content = DOMPurify.sanitize(contentCard.querySelector('.content__area').innerHTML.split('\n').map(v => v.trim()).filter(v => v).join('\n'), { FORBID_ATTR: ['style'], ADD_ATTR: ['target'] })
|
||||||
.replace(/b>/gi, 'strong>').replace(/i>/gi, 'em>')
|
.replace(/b>/gi, 'strong>').replace(/i>/gi, 'em>')
|
||||||
const contributors = Object.keys(getIterationDetails(contentID).contributors)
|
const contributors = Object.keys(getIterationDetails(contentID).contributors)
|
||||||
selectedContent.set(contentID, { content, sectionID, contributors })
|
selectedContent.set(contentID, { content, sectionID, contributors })
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user