This commit is contained in:
Peter Savchenko 2023-02-17 22:23:22 +02:00
commit 6eb3dbcbc7
No known key found for this signature in database
GPG key ID: E68306B1AB0F727C
2 changed files with 6 additions and 6 deletions

View file

@ -210,7 +210,7 @@ export default class Block extends EventsDispatcher<BlockEvents> {
*/
private didMutated = _.debounce((mutationsOrInputEvent: MutationRecord[] | InputEvent = undefined): void => {
/**
* We won't fire a Block mutation event for nodes that contain 'data-mutation-free' attributes
* We won't fire a Block mutation event if mutation contain only nodes marked with 'data-mutation-free' attributes
*/
let shouldFireUpdate;
@ -230,7 +230,7 @@ export default class Block extends EventsDispatcher<BlockEvents> {
const { addedNodes, removedNodes } = record;
const changedNodes = [
...Array.from(addedNodes),
...Array.from(removedNodes)
...Array.from(removedNodes),
];
return changedNodes.some((node) => {
@ -239,8 +239,8 @@ export default class Block extends EventsDispatcher<BlockEvents> {
}
return (node as HTMLElement).dataset.mutationFree === 'true';
})
})
});
});
if (everyRecordIsMutationFree) {
shouldFireUpdate = false;

View file

@ -512,7 +512,7 @@ describe('Editor Tools Api', () => {
/** config specified handled tag */
public static get pasteConfig(): PasteConfig {
return {
tags: ['img'], // only tag name specified. Attributes should be sanitized
tags: [ 'img' ], // only tag name specified. Attributes should be sanitized
};
}
@ -564,7 +564,7 @@ describe('Editor Tools Api', () => {
/** config specified handled tag */
public static get pasteConfig(): PasteConfig {
return {
tags: ['img'], // only tag name specified. Attributes should be sanitized
tags: [ 'img' ], // only tag name specified. Attributes should be sanitized
};
}