diff --git a/ghost/admin/app/components/modal-post-history.js b/ghost/admin/app/components/modal-post-history.js index 6df89db36f..5c9829d788 100644 --- a/ghost/admin/app/components/modal-post-history.js +++ b/ghost/admin/app/components/modal-post-history.js @@ -126,6 +126,11 @@ export default ModalComponent.extend({ const result = diff(previousHTML, currentHTML); const div = document.createElement('div'); div.innerHTML = result; + this.diffCards(div); + return div.innerHTML; + }, + + diffCards(div) { const cards = div.querySelectorAll('div[data-kg-card]'); for (const card of cards) { const hasChanges = !!card.querySelectorAll('del').length || !!card.querySelectorAll('ins').length; @@ -159,7 +164,6 @@ export default ModalComponent.extend({ card.remove(); } } - return div.innerHTML; }, updateDiff() {