Skip to content

Commit

Permalink
previewAdv, fix blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Emmolo committed Sep 30, 2024
1 parent 0f942bf commit e21181e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/previewAdv.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,13 @@ tinymce.PluginManager.add('previewAdv', (editor, url) => {
const isBlackList = blacklist.some(item => new RegExp(item).test(currentElement.innerHTML)) || blacklist.some(item => new RegExp(item).test(afterElement.innerHTML))
// === END BLACKLIST ===

if (isBlackList && thresholds.includes(index)) {
const thresholdIndex = thresholds.indexOf(index)
if (thresholdIndex !== -1) {
thresholds[thresholdIndex] += 1
if (thresholds.includes(index)) {
// Sposto i threshold di 1 se è presente un elemento blacklist
if (isBlackList) {
thresholds = thresholds.map(item => item + 1)
return
}
console.log(thresholds)
return
}

if (thresholds.includes(index)) {
const div = editor.dom.create('div', {
class: 'mceNonEditable adv-preview',
contenteditable: 'false',
Expand Down

0 comments on commit e21181e

Please sign in to comment.